diff mbox series

[FFmpeg-devel,1/2] avformat/aiffdec: Check block_duration

Message ID 20220917143209.7797-1-michael@niedermayer.cc
State Accepted
Commit 1c2b6265c87417033f990fa4a14da9d4008320a4
Headers show
Series [FFmpeg-devel,1/2] avformat/aiffdec: Check block_duration | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Sept. 17, 2022, 2:32 p.m. UTC
Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896

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

Comments

Paul B Mahol Sept. 17, 2022, 2:45 p.m. UTC | #1
On 9/17/22, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in
> type 'int'
> Fixes:
> 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/aiffdec.c | 2 ++
>  1 file changed, 2 insertions(+)
>

LGTM

> diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
> index 0487d3f0299..318e3ad742e 100644
> --- a/libavformat/aiffdec.c
> +++ b/libavformat/aiffdec.c
> @@ -372,6 +372,8 @@ got_sound:
>          av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid
> block_align value\n");
>          return AVERROR_INVALIDDATA;
>      }
> +    if (aiff->block_duration < 0)
> +        return AVERROR_INVALIDDATA;
>
>      /* Now positioned, get the sound data start and end */
>      avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
> --
> 2.17.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Michael Niedermayer Sept. 22, 2022, 3:10 p.m. UTC | #2
On Sat, Sep 17, 2022 at 04:45:52PM +0200, Paul B Mahol wrote:
> On 9/17/22, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in
> > type 'int'
> > Fixes:
> > 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/aiffdec.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> 
> LGTM

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 0487d3f0299..318e3ad742e 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -372,6 +372,8 @@  got_sound:
         av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid block_align value\n");
         return AVERROR_INVALIDDATA;
     }
+    if (aiff->block_duration < 0)
+        return AVERROR_INVALIDDATA;
 
     /* Now positioned, get the sound data start and end */
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);