[FFmpeg-devel] [PATCH 4/4] avformat/iamf: Check language_label

Michael Niedermayer michael at niedermayer.cc
Thu Mar 21 03:15:17 EET 2024


Fixes: null pointer dereference
Fixes: 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6011025237278720

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

diff --git a/libavformat/iamf.c b/libavformat/iamf.c
index 5de70dc082..f2c22ce3aa 100644
--- a/libavformat/iamf.c
+++ b/libavformat/iamf.c
@@ -89,9 +89,10 @@ void ff_iamf_free_mix_presentation(IAMFMixPresentation **pmix_presentation)
     if (!mix_presentation)
         return;
 
-    for (int i = 0; i < mix_presentation->count_label; i++)
-        av_free(mix_presentation->language_label[i]);
-    av_free(mix_presentation->language_label);
+    if (mix_presentation->language_label)
+        for (int i = 0; i < mix_presentation->count_label; i++)
+            av_free(mix_presentation->language_label[i]);
+    av_freep(&mix_presentation->language_label);
     av_iamf_mix_presentation_free(&mix_presentation->mix);
     av_freep(pmix_presentation);
 }
-- 
2.17.1



More information about the ffmpeg-devel mailing list