diff mbox series

[FFmpeg-devel,2/2] avformat/mvdec: Use 64 bit in timestamp computation

Message ID 20211215173713.7047-2-michael@niedermayer.cc
State Accepted
Commit 99b2700f5bf887cf95316a2f9e8c1082b11982ba
Headers show
Series [FFmpeg-devel,1/2] tools/target_dec_fuzzer: Adjust threshold for prores | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Michael Niedermayer Dec. 15, 2021, 5:37 p.m. UTC
Fixes: division by zero
Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz
Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048

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

Comments

Peter Ross Dec. 16, 2021, 12:26 a.m. UTC | #1
On Wed, Dec 15, 2021 at 06:37:13PM +0100, Michael Niedermayer wrote:
> Fixes: division by zero
> Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz
> Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
> index 8b54a9ab045..5d184f20a49 100644
> --- a/libavformat/mvdec.c
> +++ b/libavformat/mvdec.c
> @@ -381,7 +381,7 @@ static int mv_read_header(AVFormatContext *avctx)
>              avio_skip(pb, 8);
>              av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
>              av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
> -            timestamp += asize / (ast->codecpar->channels * bytes_per_sample);
> +            timestamp += asize / (ast->codecpar->channels * (uint64_t)bytes_per_sample);
>          }
>      } else if (!version && avio_rb16(pb) == 3) {
>          avio_skip(pb, 4);
> -- 
> 2.17.1

please apply.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
Michael Niedermayer Dec. 16, 2021, 8:03 p.m. UTC | #2
On Thu, Dec 16, 2021 at 11:26:23AM +1100, Peter Ross wrote:
> On Wed, Dec 15, 2021 at 06:37:13PM +0100, Michael Niedermayer wrote:
> > Fixes: division by zero
> > Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz
> > Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/mvdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
> > index 8b54a9ab045..5d184f20a49 100644
> > --- a/libavformat/mvdec.c
> > +++ b/libavformat/mvdec.c
> > @@ -381,7 +381,7 @@ static int mv_read_header(AVFormatContext *avctx)
> >              avio_skip(pb, 8);
> >              av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
> >              av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
> > -            timestamp += asize / (ast->codecpar->channels * bytes_per_sample);
> > +            timestamp += asize / (ast->codecpar->channels * (uint64_t)bytes_per_sample);
> >          }
> >      } else if (!version && avio_rb16(pb) == 3) {
> >          avio_skip(pb, 4);
> > -- 
> > 2.17.1
> 
> please apply.

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 8b54a9ab045..5d184f20a49 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -381,7 +381,7 @@  static int mv_read_header(AVFormatContext *avctx)
             avio_skip(pb, 8);
             av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
             av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
-            timestamp += asize / (ast->codecpar->channels * bytes_per_sample);
+            timestamp += asize / (ast->codecpar->channels * (uint64_t)bytes_per_sample);
         }
     } else if (!version && avio_rb16(pb) == 3) {
         avio_skip(pb, 4);