Browse Source

avformat/nistspheredec: initialize header_size to -1

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>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
632fdec9f4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/nistspheredec.c

+ 1
- 1
libavformat/nistspheredec.c View File

@@ -36,7 +36,7 @@ static int nist_read_header(AVFormatContext *s)
{ {
char buffer[32], coding[32] = "pcm", format[32] = "01"; char buffer[32], coding[32] = "pcm", format[32] = "01";
int bps = 0, be = 0; int bps = 0, be = 0;
int32_t header_size;
int32_t header_size = -1;
AVStream *st; AVStream *st;


st = avformat_new_stream(s, NULL); st = avformat_new_stream(s, NULL);


Loading…
Cancel
Save