summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-07-01 03:07:44 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-07-01 03:07:44 +0200
commitb42bcaef29e6ffcd9513e1ad92dbff07bea84c94 (patch)
treead8df71a150a0a16cd17df64fc357e1f13ccc459 /libavcodec
parentec837a08993d4272eb0e8687fe90025c2b9638ac (diff)
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')
-rw-r--r--libavcodec/utils.c2
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);