mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 18:49:58 +00:00
avformat/sierravmd: Check avio_read return value
Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f82af392dae_1848_HR060606.VMD Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
200cfab8c4
commit
a165964f3c
@ -204,7 +204,12 @@ static int vmd_read_header(AVFormatContext *s)
|
||||
int type;
|
||||
uint32_t size;
|
||||
|
||||
avio_read(pb, chunk, BYTES_PER_FRAME_RECORD);
|
||||
if ((ret = avio_read(pb, chunk, BYTES_PER_FRAME_RECORD)) != BYTES_PER_FRAME_RECORD) {
|
||||
av_log(s, AV_LOG_ERROR, "Failed to read frame record\n");
|
||||
if (ret >= 0)
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
type = chunk[0];
|
||||
size = AV_RL32(&chunk[2]);
|
||||
if (size > INT_MAX / 2) {
|
||||
|
Loading…
Reference in New Issue
Block a user