Commit 06cf597c authored by Anton Khirnov's avatar Anton Khirnov

yop: check that extradata is large enough.

CC:libav-stable@libav.org
parent 89f11f49
...@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx) ...@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (avctx->extradata_size < 3) {
av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata.\n");
return AVERROR_INVALIDDATA;
}
avctx->pix_fmt = AV_PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
s->num_pal_colors = avctx->extradata[0]; s->num_pal_colors = avctx->extradata[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment