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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user