avcodec/adpcm: Check input buffer size

Larger values will lead to integer overflows in intermediates
No testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5f84a7263e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-02-08 02:52:54 +01:00
parent 5d6c488db7
commit c47f085b47
+2
View File
@@ -735,6 +735,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
if(ch <= 0)
return 0;
if (buf_size > INT_MAX / 2)
return 0;
switch (avctx->codec->id) {
/* constant, only check buf_size */