asv1: 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: Martin Storsjö <martin@martin.st>
(cherry picked from commit f50803354c
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:

committed by
Luca Barbato

parent
75dabbff8b
commit
036136fa89
@@ -535,6 +535,11 @@ static av_cold int decode_init(AVCodecContext *avctx){
|
|||||||
int i;
|
int i;
|
||||||
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
|
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
|
||||||
|
|
||||||
|
if (avctx->extradata_size < 1) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "No extradata provided\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
common_init(avctx);
|
common_init(avctx);
|
||||||
init_vlcs(a);
|
init_vlcs(a);
|
||||||
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
|
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
|
||||||
|
Reference in New Issue
Block a user