ffmpeg | branch: master | Kacper Michajłow <kaspe...@gmail.com> | Tue Jun 25 23:50:30 2024 +0200| [02b3fc582693477555ce151515972bfee04367a9] | committer: Michael Niedermayer
avformat/nuv: return early if header id fails to read Fixes use of uninitialized value in memcmp below, reported by MSAN. Found by OSS-Fuzz. Signed-off-by: Kacper Michajłow <kaspe...@gmail.com> Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02b3fc582693477555ce151515972bfee04367a9 --- libavformat/nuv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 507a73b0fe..49915ecf16 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -165,7 +165,9 @@ static int nuv_header(AVFormatContext *s) int is_mythtv, width, height, v_packs, a_packs, ret; AVStream *vst = NULL, *ast = NULL; - avio_read(pb, id_string, 12); + if ((ret = ffio_read_size(pb, id_string, 12)) < 0) + return ret; + is_mythtv = !memcmp(id_string, "MythTVVideo", 12); avio_skip(pb, 5); // version string avio_skip(pb, 3); // padding _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".