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 <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-11-03 20:54:29 +01:00
parent e30d957a9b
commit 96d45c3b21
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 1 deletions

View File

@ -567,7 +567,8 @@ static int viv_read_header(AVFormatContext *s)
v = avio_r8(pb); v = avio_r8(pb);
avio_seek(pb, v, SEEK_CUR); 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); key = decode_key(keybuffer);
viv->sb_key = key; viv->sb_key = key;