diff mbox series

[FFmpeg-devel,04/21] avformat/dashdec: Don't overwrite and leak old initialization fragments

Message ID 20200919163610.1099233-4-andreas.rheinhardt@gmail.com
State Accepted
Commit 17963a6ad7e41312312b32a4ce590abb9805f799
Headers show
Series [FFmpeg-devel,01/21] avformat/dashdec: Avoid double free on error | expand

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>
---
One could also error out instead.

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

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index d84da16dbd..3f51e079cf 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -614,6 +614,7 @@  static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati
         initialization_val = xmlGetProp(fragmenturl_node, "sourceURL");
         range_val = xmlGetProp(fragmenturl_node, "range");
         if (initialization_val || range_val) {
+            free_fragment(&rep->init_section);
             rep->init_section = get_Fragment(range_val);
             if (!rep->init_section) {
                 xmlFree(initialization_val);