[FFmpeg-cvslog] avformat/ilbc: Check avio_read() for failure

Michael Niedermayer git at videolan.org
Fri May 16 20:58:04 EEST 2025


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  3 20:47:07 2024 +0100| [3dec911f86deb7f5109c4b8ea5c2b8459297c9c8] | committer: Michael Niedermayer

avformat/ilbc: Check avio_read() for failure

Fixes: use of uninitialized value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-6656646223298560-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e30d957a9bacf7f7307c640aa0bd1e70cb3bbe7e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/ilbc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/ilbc.c b/libavformat/ilbc.c
index ba11953b59..b5d3e00060 100644
--- a/libavformat/ilbc.c
+++ b/libavformat/ilbc.c
@@ -74,7 +74,8 @@ static int ilbc_read_header(AVFormatContext *s)
     AVStream *st;
     uint8_t header[9];
 
-    avio_read(pb, header, 9);
+    if (avio_read(pb, header, 9) != 9)
+        return AVERROR_INVALIDDATA;
 
     st = avformat_new_stream(s, NULL);
     if (!st)



More information about the ffmpeg-cvslog mailing list