summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-27 14:03:16 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-28 09:04:43 +0200
commit41f3c60fbb7420f41295c8e0cf80acf9e71f72d0 (patch)
tree7d4abe6e6423ab4afc466d56a003019ced0e01f1 /libavcodec
parentf91833210e740f6447e94b58067889a710ce9eca (diff)
Avoid a null pointer dereference in avcodec_decode_video2().
This could happen if oom occured while probing a file. Reported in ticket #1900.
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 9fe3a16db7..e0819f4515 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1920,6 +1920,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
// copy to ensure we do not change avpkt
AVPacket tmp = *avpkt;
+ if (!avctx->codec)
+ return AVERROR(EINVAL);
if (avctx->codec->type != AVMEDIA_TYPE_VIDEO) {
av_log(avctx, AV_LOG_ERROR, "Invalid media type for video\n");
return AVERROR(EINVAL);