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

Steven Liu lq at chinaffmpeg.org
Fri Aug 26 05:50:16 EEST 2022


fix CID: 1512404
When there have no val value should not xmlFree it.

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

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;
 }
-- 
2.25.0



More information about the ffmpeg-devel mailing list