aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-22 22:41:35 +0100
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-23 03:25:25 +0100
commit691f9be622c73c5743f38ba494eabc67aa5f43a6 (patch)
tree55d49ebba0b26797d2b3d2fdb278a4e8f2517392
parent65ce8f8895531e7c3fa6021a1f786836bfd63c48 (diff)
downloadffmpeg-691f9be622c73c5743f38ba494eabc67aa5f43a6.tar.gz
lavc/anm: fix mem leak in case of init failure
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
-rw-r--r--libavcodec/anm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 79a87dde99..3727534729 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -47,8 +47,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
- if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256)
+ if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256) {
+ av_frame_free(&s->frame);
return AVERROR_INVALIDDATA;
+ }
bytestream2_skipu(&s->gb, 16 * 8);
for (i = 0; i < 256; i++)