diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-07-01 11:32:56 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2017-07-26 23:23:47 +0200 |
commit | de77671438c24ffea93398c8dc885d4dd04477de (patch) | |
tree | a6c7ff57205c6fcbc3cebe00763b8080a7d148e3 /libavcodec/decode.c | |
parent | 70946e605924e2108c39f96faa369c220177f301 (diff) | |
download | ffmpeg-de77671438c24ffea93398c8dc885d4dd04477de.tar.gz |
decode: avoid leaks on failure in ff_get_buffer()
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
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 9644e89f48..f7cd7f6870 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1069,6 +1069,9 @@ end: frame->height = avctx->height; } + if (ret < 0) + av_frame_unref(frame); + return ret; } |