mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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 <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6aeb084c39
commit
02b3fc5826
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user