소스 검색

Fixed memory leak in testffmpeg EGL codepath

Fixes https://github.com/libsdl-org/SDL/issues/14908
Sam Lantinga 1 개월 전
부모
커밋
ee38b7c3df
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 */