Fixed memory leak in testffmpeg EGL codepath

Fixes https://github.com/libsdl-org/SDL/issues/14908
This commit is contained in:
Sam Lantinga
2026-01-28 08:20:44 -08:00
parent c1e715439a
commit ee38b7c3df

View File

@@ -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 */