aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-05 12:14:05 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-05 12:14:05 +0000
commit5be5daf1e5929192650dc17eab02c26447df13d1 (patch)
treec2bae805cffeb53caa9cf24ebfe7c8bddd39abea
parente30004fa733ec64b6ff90678098c1f1132d4d603 (diff)
downloadffmpeg-5be5daf1e5929192650dc17eab02c26447df13d1.tar.gz
Check that palctrl is available on init instead of crashing when trying to use
it on decode. Fixes mpeg2/smclockmpeg2.avi.2.1 from issue 1240. Originally committed as revision 19347 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/qpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index 20f166329d..6b5d8732d9 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -289,6 +289,10 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;
+ if (!avctx->palctrl) {
+ av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
+ return -1;
+ }
a->avctx = avctx;
avctx->pix_fmt= PIX_FMT_PAL8;
a->refdata = av_malloc(avctx->width * avctx->height);