diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-10-22 15:16:41 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-10-24 15:51:20 -0300 |
commit | 262eef6b899ca39f80296e6eb701e895549d8a83 (patch) | |
tree | e6b37938420df7a7636c20ef567e46cea20c85c1 | |
parent | 531fbce0b281be2450bbf0230c2de539230a7d84 (diff) | |
download | ffmpeg-262eef6b899ca39f80296e6eb701e895549d8a83.tar.gz |
avformat/mpeg: Don't free unintialized pointer
In order to fix a potential memleak upon failure, 0b8956b2 made sure that
a buffer given by a pointer was freed upon error. But this pointer was
only initialized upon use and in several cases (Clang gives no fewer
than 13 -Wsometimes-uninitialized warnings) this meant that an
uninitialized pointer was used to free a buffer. So initialize the
pointer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavformat/mpeg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 3750de65a1..46c59163fd 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -720,7 +720,7 @@ static int vobsub_read_header(AVFormatContext *s) int i, ret = 0, header_parsed = 0, langidx = 0; MpegDemuxContext *vobsub = s->priv_data; size_t fname_len; - char *header_str; + char *header_str = NULL; AVBPrint header; int64_t delay = 0; AVStream *st = NULL; |