diff mbox series

[FFmpeg-devel,10/21] avformat/dashdec: Fix memleaks upon read_header failure

Message ID 20200919163610.1099233-10-andreas.rheinhardt@gmail.com
State Accepted
Commit 06e31f953ec6e4332f65e9ece72cc02166636095
Headers show
Series [FFmpeg-devel,01/21] avformat/dashdec: Avoid double free on error
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 19, 2020, 4:35 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Making sure that it's safe to call this demuxer's read_close function
upon read_header failure was of course the initial rationale behind this
patchset.

 libavformat/dashdec.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 4f87ef981b..311a19e425 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -2047,6 +2047,7 @@  static int copy_init_section(struct representation *rep_dest, struct representat
     return 0;
 }
 
+static int dash_close(AVFormatContext *s);
 
 static int dash_read_header(AVFormatContext *s)
 {
@@ -2178,6 +2179,7 @@  static int dash_read_header(AVFormatContext *s)
 
     return 0;
 fail:
+    dash_close(s);
     return ret;
 }