diff mbox series

[FFmpeg-devel,29/33] avcodec/mpegpicture: Let ff_mpeg_unref_picture() free picture tables

Message ID AM7PR03MB66607DFE857738B964916A2D8F209@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit d0ceb90f44ff342e8de8259548a04fb9fce2ed68
Headers show
Series [FFmpeg-devel,01/21] avcodec/h263: Remove declaration for inexistent function | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 26, 2022, 9:34 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegpicture.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c
index 0652b7c879..f78a3c23e3 100644
--- a/libavcodec/mpegpicture.c
+++ b/libavcodec/mpegpicture.c
@@ -290,7 +290,8 @@  fail:
 }
 
 /**
- * Deallocate a picture.
+ * Deallocate a picture; frees the picture tables in case they
+ * need to be reallocated anyway.
  */
 void ff_mpeg_unref_picture(AVCodecContext *avctx, Picture *pic)
 {
@@ -443,8 +444,6 @@  int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared)
 
     if (ret >= 0 && ret < MAX_PICTURE_COUNT) {
         if (picture[ret].needs_realloc) {
-            picture[ret].needs_realloc = 0;
-            ff_free_picture_tables(&picture[ret]);
             ff_mpeg_unref_picture(avctx, &picture[ret]);
         }
     }