]> git.sesse.net Git - ffmpeg/commitdiff
decode: avoid leaks on failure in ff_get_buffer()
authorAnton Khirnov <anton@khirnov.net>
Fri, 13 Oct 2017 16:59:16 +0000 (18:59 +0200)
committerJames Almer <jamrial@gmail.com>
Mon, 30 Oct 2017 00:25:49 +0000 (21:25 -0300)
If the get_buffer() call fails, the frame might have some side data
already set. Make sure it gets freed.

Merges Libav commit de77671438c24ffea93398c8dc885d4dd04477de.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/decode.c

index 15fc82ad39a505f98f24d0d6831d15a3d02befc4..86fe5aef52a9c3ab315d39eaf37592df92077dbc 100644 (file)
@@ -1598,6 +1598,9 @@ end:
         frame->height = avctx->height;
     }
 
+    if (ret < 0)
+        av_frame_unref(frame);
+
     return ret;
 }