[FFmpeg-cvslog] lavc: do not leak frames in avcodec_decode_audio4
Luca Barbato
git at videolan.org
Wed May 8 13:37:15 CEST 2013
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue May 7 02:02:51 2013 +0200| [e55e8b2c362a60bad66929d83d8c83b0d7f5ffc9] | committer: Luca Barbato
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 at chromium.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e55e8b2c362a60bad66929d83d8c83b0d7f5ffc9
---
libavcodec/utils.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index df4e305..a6a1a65 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);
}
More information about the ffmpeg-cvslog
mailing list