diff mbox series

[FFmpeg-devel,1/3] avformat/dashdec: check init_section before use it.

Message ID 20210112132004.23534-1-liuqi05@kuaishou.com
State Superseded
Headers show
Series [FFmpeg-devel,1/3] avformat/dashdec: check init_section before use it. | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Steven Liu Jan. 12, 2021, 1:20 p.m. UTC
because there have no Initialization in SegmentTemplate, so
it will have no init_section for init segment file.
but in the is_common_init_section_exist function it will be used for
check to url, url_offset and size, so check init_section before use init_section

fix ticket: 9062

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
---
 libavformat/dashdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 693fc7372b..5f9b9ba882 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1992,7 +1992,10 @@  static int is_common_init_section_exist(struct representation **pls, int n_pls)
     url_offset = first_init_section->url_offset;
     size = pls[0]->init_section->size;
     for (i=0;i<n_pls;i++) {
-        if (av_strcasecmp(pls[i]->init_section->url,url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
+        if (!pls[i]->init_section)
+            continue;
+
+        if (av_strcasecmp(pls[i]->init_section->url, url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
             return 0;
         }
     }