diff mbox series

[FFmpeg-devel,1/5] avformat/sbgdec: Use av_sat_add64() in str_to_time()

Message ID 20210131215605.28190-1-michael@niedermayer.cc
State Accepted
Commit 5441699f8392bc3442f32137d8128d98a3b7b812
Headers show
Series [FFmpeg-devel,1/5] avformat/sbgdec: Use av_sat_add64() in str_to_time() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 31, 2021, 9:56 p.m. UTC
Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/sbgdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas George Feb. 1, 2021, 10:39 a.m. UTC | #1
Michael Niedermayer (12021-01-31):
> Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
> Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/sbgdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

No objection.

Regards,
Michael Niedermayer Feb. 1, 2021, 5 p.m. UTC | #2
On Mon, Feb 01, 2021 at 11:39:42AM +0100, Nicolas George wrote:
> Michael Niedermayer (12021-01-31):
> > Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
> > Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/sbgdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> No objection.

will apply

thx

[...]
Michael Niedermayer March 13, 2021, 3:21 p.m. UTC | #3
On Sun, Jan 31, 2021 at 10:56:01PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
> Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/sbgdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index 8672e2e976..64c84c1618 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -199,7 +199,7 @@  static int str_to_time(const char *str, int64_t *rtime)
             cur = end;
         ts = av_clipd(seconds * AV_TIME_BASE, INT64_MIN/2, INT64_MAX/2);
     }
-    *rtime = (hours * 3600LL + minutes * 60LL) * AV_TIME_BASE + ts;
+    *rtime = av_sat_add64((hours * 3600LL + minutes * 60LL) * AV_TIME_BASE, ts);
     return cur - str;
 }