ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Sun 
Nov  3 20:54:29 2024 +0100| [96d45c3b212689f82bff2530c3637405df9e9369] | 
committer: Michael Niedermayer

avformat/vividas: Check avio_read() for failure

Fixes: use of uninitialized value (untested)
Fixes: 
42537627/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5505802505355264

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <[email protected]>

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

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

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 130b81ebbe..bec4ad7cec 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -567,7 +567,8 @@ static int viv_read_header(AVFormatContext *s)
     v = avio_r8(pb);
     avio_seek(pb, v, SEEK_CUR);
 
-    avio_read(pb, keybuffer, 187);
+    if (avio_read(pb, keybuffer, 187) != 187)
+        return AVERROR_INVALIDDATA;
     key = decode_key(keybuffer);
     viv->sb_key = key;
 

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to