diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 18:27:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 18:35:14 +0100 |
commit | b2ae92110f9ec31c254e85eb86719827e80362e6 (patch) | |
tree | 4809f2464ead490b266e55c3ba9f9d391438316d | |
parent | b821def9f5ee9db7c72db6e5232f94ff25ee05fd (diff) | |
download | ffmpeg-b2ae92110f9ec31c254e85eb86719827e80362e6.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mov.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 8dc60624c1..a4804e4d69 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -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); |