[FFmpeg-cvslog] avformat/iamfdec: Check nb_layers before dereferencing layer

Michael Niedermayer git at videolan.org
Wed Aug 14 19:23:14 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul 16 23:19:58 2024 +0200| [d7f83fc2f423863b78c140ba23b5d28058a59f45] | committer: Michael Niedermayer

avformat/iamfdec: Check nb_layers before dereferencing layer

Fixes: dereferencing pointers near NULL
Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632
Fixes: 70877/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5348547432611840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/iamfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c
index ce6d4aa064..2e6608b868 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;



More information about the ffmpeg-cvslog mailing list