avformat/nistspheredec: initialize header_size to -1
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Dec 2013 17:07:30 +0000 (18:07 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Dec 2013 17:08:58 +0000 (18:08 +0100)
Fixes use of uninitialized memory
This also avoids the need to check the scanf() return as the subsequent check catches it
Fixes: msan_uninit-mem_7f712e4dc173_7414_nist_ulaw.nist
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nistspheredec.c

index 76f65ec..2c96686 100644 (file)
@@ -36,7 +36,7 @@ static int nist_read_header(AVFormatContext *s)
 {
     char buffer[32], coding[32] = "pcm", format[32] = "01";
     int bps = 0, be = 0;
-    int32_t header_size;
+    int32_t header_size = -1;
     AVStream *st;
 
     st = avformat_new_stream(s, NULL);