aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wtvdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-07 14:55:48 +0100
committerJames Almer <jamrial@gmail.com>2020-01-07 22:35:27 -0300
commit373c1c9b691fd4c6831b3a114a006b639304c2af (patch)
tree2302aed48471bb7e2f6d9427897f2a76eb54236c /libavformat/wtvdec.c
parentdce2e0657eaa66f82527ab833853cc1da99097ca (diff)
downloadffmpeg-373c1c9b691fd4c6831b3a114a006b639304c2af.tar.gz
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>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r--libavformat/wtvdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 706e8ca38d..92629bb31b 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -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