Commit f5080335 authored by Martin Storsjö's avatar Martin Storsjö

asvdec: Verify the amount of extradata

The init function reads one byte of extradata.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 72fe16a1
...@@ -274,6 +274,11 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -274,6 +274,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2; const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2;
int i; int i;
if (avctx->extradata_size < 1) {
av_log(avctx, AV_LOG_ERROR, "No extradata provided\n");
return AVERROR_INVALIDDATA;
}
ff_asv_common_init(avctx); ff_asv_common_init(avctx);
init_vlcs(a); init_vlcs(a);
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_asv_scantab); ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_asv_scantab);
......
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