decode: avoid leaks on failure in ff_get_buffer()
authorAnton Khirnov <anton@khirnov.net>
Sat, 1 Jul 2017 09:32:56 +0000 (11:32 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 26 Jul 2017 21:23:47 +0000 (23:23 +0200)
If the get_buffer() call fails, the frame might have some side data
already set. Make sure it gets freed.

CC: libav-stable@libav.org
libavcodec/decode.c

index 9644e89..f7cd7f6 100644 (file)
@@ -1069,6 +1069,9 @@ end:
         frame->height = avctx->height;
     }
 
+    if (ret < 0)
+        av_frame_unref(frame);
+
     return ret;
 }