Browse Source

avformat/wtvdec: Fix memleak when reading header fails

Fixes #8314.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 373c1c9b69)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
release/3.2
Andreas Rheinhardt 6 years ago
parent
commit
78bf4ac778
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/wtvdec.c

+ 3
- 1
libavformat/wtvdec.c View File

@@ -993,8 +993,10 @@ static int read_header(AVFormatContext *s)
}

ret = parse_chunks(s, SEEK_TO_DATA, 0, 0);
if (ret < 0)
if (ret < 0) {
wtvfile_close(wtv->pb);
return ret;
}
avio_seek(wtv->pb, -32, SEEK_CUR);

timeline_pos = avio_tell(s->pb); // save before opening another file


Loading…
Cancel
Save