yop: check that extradata is large enough.

CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-01-30 07:00:50 +01:00
parent 89f11f498b
commit 06cf597c35
1 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
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;
s->num_pal_colors = avctx->extradata[0];