From 77a4c8b959fa9bc6bcaa42b40a0b046cdf3fec38 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 28 May 2012 17:08:06 +0200 Subject: yop: check for missing extradata Fixes null ptr deref Fixes Ticket1361 Signed-off-by: Michael Niedermayer --- libavcodec/yop.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/yop.c') diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 05abb24553..ac17297915 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; avcodec_get_frame_defaults(&s->frame); -- cgit v1.2.3