[FFmpeg-cvslog] Avoid a null pointer dereference in avcodec_decode_audio4().

Carl Eugen Hoyos git at videolan.org
Mon Jul 1 03:31:55 CEST 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Mon Jul  1 03:07:44 2013 +0200| [b42bcaef29e6ffcd9513e1ad92dbff07bea84c94] | committer: Carl Eugen Hoyos

Avoid a null pointer dereference in avcodec_decode_audio4().

This could happen if oom occured while probing a file.
Fixes ticket #2722.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b42bcaef29e6ffcd9513e1ad92dbff07bea84c94
---

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e659cc5..f26e260 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2061,6 +2061,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n");
         return AVERROR(EINVAL);
     }
+    if (!avctx->codec)
+        return AVERROR(EINVAL);
     if (avctx->codec->type != AVMEDIA_TYPE_AUDIO) {
         av_log(avctx, AV_LOG_ERROR, "Invalid media type for audio\n");
         return AVERROR(EINVAL);



More information about the ffmpeg-cvslog mailing list