diff mbox series

[FFmpeg-devel,2/2] avformat/dashdec: check val before xmlFree it

Message ID 20220826025016.29627-2-lq@chinaffmpeg.org
State New
Headers show
Series [FFmpeg-devel,1/2] avformat/imfdec: check track valid before use it | expand

Commit Message

Steven Liu Aug. 26, 2022, 2:50 a.m. UTC
fix CID: 1512404
When there have no val value should not xmlFree it.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/dashdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 63bf7e96a5..bf9adf2183 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1185,8 +1185,10 @@  static int parse_programinformation(AVFormatContext *s, xmlNodePtr node)
             }
         }
         node = xmlNextElementSibling(node);
-        xmlFree(val);
-        val = NULL;
+        if (val) {
+            xmlFree(val);
+            val = NULL;
+        }
     }
     return 0;
 }