[FFmpeg-cvslog] avformat/vqf: Ensure that comm_chunk is fully read

Michael Niedermayer git at videolan.org
Mon Aug 4 23:57:35 EEST 2025


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 23 13:36:42 2025 +0200| [b128f50eef5bc71f00c13b0e06386a1b64c63df6] | committer: Michael Niedermayer

avformat/vqf: Ensure that comm_chunk is fully read

Fixes: use of uninitialized memory
Fixes: 412125811/clusterfuzz-testcase-minimized-ffmpeg_dem_VQF_fuzzer-6253774274887680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1b7a327b3a43df6ab82885cea5ae02bf9dd899a9)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/vqf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 3fdb7d1781..1f1f2eae2c 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -20,6 +20,7 @@
  */
 
 #include "avformat.h"
+#include "avio_internal.h"
 #include "demux.h"
 #include "internal.h"
 #include "libavutil/intreadwrite.h"
@@ -142,7 +143,9 @@ static int vqf_read_header(AVFormatContext *s)
             if (len < 12)
                 return AVERROR_INVALIDDATA;
 
-            avio_read(s->pb, comm_chunk, 12);
+            ret = ffio_read_size(s->pb, comm_chunk, 12);
+            if (ret < 0)
+                return ret;
             st->codecpar->ch_layout.nb_channels = AV_RB32(comm_chunk) + 1;
             read_bitrate        = AV_RB32(comm_chunk + 4);
             rate_flag           = AV_RB32(comm_chunk + 8);



More information about the ffmpeg-cvslog mailing list