You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-06 06:27:36 +02:00
avcodec/utils: Better check for channels in av_get_audio_frame_duration()
Fixes integer overflow
Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e16ad2868
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -3490,7 +3490,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
|
|||||||
return frame_bytes * 8 / bps;
|
return frame_bytes * 8 / bps;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch > 0) {
|
if (ch > 0 && ch < INT_MAX/16) {
|
||||||
/* calc from frame_bytes and channels */
|
/* calc from frame_bytes and channels */
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case AV_CODEC_ID_ADPCM_AFC:
|
case AV_CODEC_ID_ADPCM_AFC:
|
||||||
|
Reference in New Issue
Block a user