OSDN Git Service

avformat/rmdec: zero string destination before use
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Dec 2013 11:52:23 +0000 (12:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Dec 2013 22:27:09 +0000 (23:27 +0100)
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9677850d99_4635_crashed.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rmdec.c

index b0876fe..a8af378 100644 (file)
@@ -185,6 +185,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
             avio_read(pb, buf, 4);
             buf[4] = 0;
         } else {
+            AV_WL32(buf, 0);
             get_str8(pb, buf, sizeof(buf)); /* desc */
             ast->deint_id = AV_RL32(buf);
             get_str8(pb, buf, sizeof(buf)); /* desc */