Commit a165964f authored by Michael Niedermayer's avatar Michael Niedermayer

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: default avatarMichael Niedermayer <>
parent 200cfab8
......@@ -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)
goto error;
type = chunk[0];
size = AV_RL32(&chunk[2]);
if (size > INT_MAX / 2) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment