]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dashdec: Don't leave representation in inconsistent state on error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 7 Sep 2020 18:32:51 +0000 (20:32 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 21 Sep 2020 02:31:26 +0000 (04:31 +0200)
This currently doesn't cause any trouble, because the only caller did
not clean up the representation upon error at all; but fixing this is
a prerequisite for doing so.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/dashdec.c

index f81b323d96d1c1bcb69caa7f35097ae1ea6573c5..d84da16dbd4552d45376a610d4b74759f66f843a 100644 (file)
@@ -627,7 +627,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati
                                                      initialization_val);
 
             if (!rep->init_section->url) {
-                av_free(rep->init_section);
+                av_freep(&rep->init_section);
                 xmlFree(initialization_val);
                 xmlFree(range_val);
                 return AVERROR(ENOMEM);