aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-05-07 02:02:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-05-07 14:37:32 +0200
commite55e8b2c362a60bad66929d83d8c83b0d7f5ffc9 (patch)
tree19624c0fb0a57b5895c5535d22d77c744873ddb4
parente0c53c3408181d2e7d544eb65fc7355a79438dfe (diff)
downloadffmpeg-e55e8b2c362a60bad66929d83d8c83b0d7f5ffc9.tar.gz
lavc: do not leak frames in avcodec_decode_audio4
Notwithstanding the return value the frame should be freed if is not going to be used. Reported-by: Matthew Wolenetz <wolenetz@chromium.org>
-rw-r--r--libavcodec/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index df4e30524d..a6a1a653ca 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1463,9 +1463,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
frame->extended_buf = NULL;
frame->nb_extended_buf = 0;
}
- }
-
- if (ret < 0 && frame->data[0])
+ } else if (frame->data[0])
av_frame_unref(frame);
}