avcodec/wavarc: check that nb_samples is valid

This commit is contained in:
Paul B Mahol 2023-02-06 16:32:38 +01:00
parent bdc76f467f
commit d7c2da1f8d

View File

@ -258,6 +258,10 @@ static int decode_2slp(AVCodecContext *avctx,
return AVERROR_EOF;
case 8:
s->nb_samples = get_urice(gb, 8);
if (s->nb_samples > 570) {
s->nb_samples = 570;
return AVERROR_INVALIDDATA;
}
continue;
case 7:
s->shift = get_urice(gb, 2);