Commit b2ae9211 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flashsv: check avio_read() return in mov_read_udta_string()

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3f90a8606a_3018_Sequence_1-Apple_ProRes_422_LT.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b821def9
......@@ -394,7 +394,9 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) { // MAC Encoded
mov_read_mac_string(c, pb, str_size, str, sizeof(str));
} else {
avio_read(pb, str, str_size);
int ret = avio_read(pb, str, str_size);
if (ret != str_size)
return ret < 0 ? ret : AVERROR_INVALIDDATA;
str[str_size] = 0;
}
av_dict_set(&c->fc->metadata, key, str, 0);
......
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