mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
avcodec/truespeech: reject iterations count whose * 240 product overflows 32-bit
Found-by: Anthropic agents; validated and reported by Ada Logics.
Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d30dead35e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5251f49710950561a85e49b2b2f43500c04ccf22)
This commit is contained in:
1 parent
6bb2d6999b
commit
e2fb95fd68
1 file changed
+5
@@ -323,6 +323,11 @@ static int truespeech_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
"Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size);
|
||||
return -1;
|
||||
}
|
||||
if (iterations > INT_MAX / 240) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Too large input buffer (%d bytes); per-block sample count overflows\n", buf_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = iterations * 240;
|
||||
|
||||
Reference in new issue
Block a user