diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:08:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:34:50 +0200 |
commit | 62cbdd71eb2c0051cc5a9797db5ea82399337344 (patch) | |
tree | 6d57bd6298b402e1cbce3309b63ea34888e66e65 | |
parent | 42bdeaecd41cb99f80901ce1a9649a9cb2b639b6 (diff) | |
download | ffmpeg-62cbdd71eb2c0051cc5a9797db5ea82399337344.tar.gz |
yop: check for missing extradata
Fixes null ptr deref
Fixes Ticket1361
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 77a4c8b959fa9bc6bcaa42b40a0b046cdf3fec38)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/yop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 1eb76b128e..1adbd612ad 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx) return -1; } + if (!avctx->extradata) { + av_log(avctx, AV_LOG_ERROR, "extradata missing\n"); + return AVERROR_INVALIDDATA; + } + avctx->pix_fmt = PIX_FMT_PAL8; s->num_pal_colors = avctx->extradata[0]; |