diff mbox series

[FFmpeg-devel,3/5] avformat/iamfdec: Check nb_layers before dereferencing layer

Message ID 20240717112745.1624968-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/5] avutil/timecode: Use a 64bit framenum internally | expand

Checks

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

Commit Message

Michael Niedermayer July 17, 2024, 11:27 a.m. UTC
Fixes: dereferencing pointers near NULL
Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632

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

Comments

Michael Niedermayer July 21, 2024, 1:36 p.m. UTC | #1
On Wed, Jul 17, 2024 at 01:27:43PM +0200, Michael Niedermayer wrote:
> Fixes: dereferencing pointers near NULL
> Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/iamfdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset, except this one (to give james a little more time to
review this)

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c
index ce6d4aa0647..2e6608b8685 100644
--- a/libavformat/iamfdec.c
+++ b/libavformat/iamfdec.c
@@ -107,7 +107,7 @@  static int iamf_read_header(AVFormatContext *s)
             if (ret < 0)
                 return ret;
 
-            if (!i && !j && audio_element->layers[0].substream_count == 1)
+            if (!i && !j && audio_element->nb_layers && audio_element->layers[0].substream_count == 1)
                 st->disposition |= AV_DISPOSITION_DEFAULT;
             else
                 st->disposition |= AV_DISPOSITION_DEPENDENT;