diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-01 03:07:44 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-01 03:07:44 +0200 |
commit | b42bcaef29e6ffcd9513e1ad92dbff07bea84c94 (patch) | |
tree | ad8df71a150a0a16cd17df64fc357e1f13ccc459 /libavcodec/utils.c | |
parent | ec837a08993d4272eb0e8687fe90025c2b9638ac (diff) | |
download | ffmpeg-b42bcaef29e6ffcd9513e1ad92dbff07bea84c94.tar.gz |
Avoid a null pointer dereference in avcodec_decode_audio4().
This could happen if oom occured while probing a file.
Fixes ticket #2722.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e659cc546c..f26e260d3d 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); |