Просмотр исходного кода

Fixed memory leak in testffmpeg EGL codepath

Fixes https://github.com/libsdl-org/SDL/issues/14908

(cherry picked from commit ee38b7c3dfc4f534195cf9a6f6e5227368e1b4e3)
Sam Lantinga 1 месяц назад
Родитель
Сommit
9c0b773f09
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      test/testffmpeg.c

+ 2 - 0
test/testffmpeg.c

@@ -737,6 +737,7 @@ static bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture)
             glActiveTextureARBFunc(GL_TEXTURE0_ARB + image_index);
             glBindTexture(GL_TEXTURE_2D, textures[image_index]);
             glEGLImageTargetTexture2DOESFunc(GL_TEXTURE_2D, image);
+            eglDestroyImage(display, image);
             ++image_index;
         }
     }
@@ -922,6 +923,7 @@ static bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture)
     glActiveTextureARBFunc(GL_TEXTURE0_ARB);
     glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureID);
     glEGLImageTargetTexture2DOESFunc(GL_TEXTURE_EXTERNAL_OES, image);
+    eglDestroyImage(display, image);
     return true;
 }
 #endif /* HAVE_EGL */