[FFmpeg-cvslog] avcodec/utils: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration calculation

2021-09-08 Thread Michael Niedermayer
ffmpeg | branch: release/4.4 | Michael Niedermayer  | 
Thu Jun 24 20:00:05 2021 +0200| [417bc2a5b087b569a43652948643a11780a0442c] | 
committer: Michael Niedermayer

avcodec/utils: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration 
calculation

Fixes: signed integer overflow: 486539264 * 14 cannot be represented in type 
'int'
Fixes: 
35281/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6068262742917120

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 00ae9b77ef757f82660b4b3d2f490374a4f209fd)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=417bc2a5b087b569a43652948643a11780a0442c
---

 libavcodec/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3f69c9c114..af121ff910 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -749,7 +749,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int 
sr, int ch, int ba,
 case AV_CODEC_ID_ADPCM_THP:
 case AV_CODEC_ID_ADPCM_THP_LE:
 if (extradata)
-return frame_bytes * 14 / (8 * ch);
+return frame_bytes * 14LL / (8 * ch);
 break;
 case AV_CODEC_ID_ADPCM_XA:
 return (frame_bytes / 128) * 224 / ch;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/utils: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration calculation

2021-06-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Jun 24 20:00:05 2021 +0200| [00ae9b77ef757f82660b4b3d2f490374a4f209fd] | 
committer: Michael Niedermayer

avcodec/utils: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration 
calculation

Fixes: signed integer overflow: 486539264 * 14 cannot be represented in type 
'int'
Fixes: 
35281/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6068262742917120

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00ae9b77ef757f82660b4b3d2f490374a4f209fd
---

 libavcodec/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 342709353f..88e88bc958 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -712,7 +712,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int 
sr, int ch, int ba,
 case AV_CODEC_ID_ADPCM_THP:
 case AV_CODEC_ID_ADPCM_THP_LE:
 if (extradata)
-return frame_bytes * 14 / (8 * ch);
+return frame_bytes * 14LL / (8 * ch);
 break;
 case AV_CODEC_ID_ADPCM_XA:
 return (frame_bytes / 128) * 224 / ch;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".