From d7c2da1f8d14672ff0768305b87cf118ad320469 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 6 Feb 2023 16:32:38 +0100 Subject: [PATCH] avcodec/wavarc: check that nb_samples is valid --- libavcodec/wavarc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c index 898c3c2055..caab08cb24 100644 --- a/libavcodec/wavarc.c +++ b/libavcodec/wavarc.c @@ -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);