diff mbox

[FFmpeg-devel] avformat/dashdec: fix for ticket #7336

Message ID CAAtY0+CG6j4-QERksmfRryJFKyKJrm=DsoWjCEf_EsEYf-z1Gg@mail.gmail.com
State New
Headers show

Commit Message

Jacek Jendrzej July 31, 2018, 3:52 p.m. UTC
Hi.
fix for ticket #7336

Comments

Liu Steven Aug. 1, 2018, 6:29 a.m. UTC | #1
> 在 2018年7月31日,下午11:52,jacek jogo <overx300@gmail.com> 写道:
> 
> Hi.
> fix for ticket #7336
> <0001-fix-possible-segfault-if-dash-stream-have-only-audio.patch>_______________________________________________
LGTM


Thanks
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Liu Steven Aug. 7, 2018, 4:32 a.m. UTC | #2
> 在 2018年8月1日,下午2:29,Liu Steven <lq@chinaffmpeg.org> 写道:
> 
> 
> 
>> 在 2018年7月31日,下午11:52,jacek jogo <overx300@gmail.com> 写道:
>> 
>> Hi.
>> fix for ticket #7336
>> <0001-fix-possible-segfault-if-dash-stream-have-only-audio.patch>_______________________________________________
> LGTM
> 
pushed
> 
> Thanks
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
diff mbox

Patch

From a8948069bbf8995414bb20f578a1553c522b5d06 Mon Sep 17 00:00:00 2001
From: Jacek Jendrzej <overx300@gmail.com>
Date: Mon, 30 Jul 2018 17:17:14 +0200
Subject: [PATCH] fix possible segfault, if dash stream have only audio or
 video pid

---
 libavformat/dashdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 89f3ac2759..f0939f4425 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1936,7 +1936,8 @@  static int dash_read_header(AVFormatContext *s)
         s->duration = (int64_t) c->media_presentation_duration * AV_TIME_BASE;
     }
 
-    c->is_init_section_common_video = is_common_init_section_exist(c->videos, c->n_videos);
+    if(c->n_videos)
+        c->is_init_section_common_video = is_common_init_section_exist(c->videos, c->n_videos);
 
     /* Open the demuxer for video and audio components if available */
     for (i = 0; i < c->n_videos; i++) {
@@ -1952,7 +1953,8 @@  static int dash_read_header(AVFormatContext *s)
         ++stream_index;
     }
 
-  c->is_init_section_common_audio = is_common_init_section_exist(c->audios, c->n_audios);
+    if(c->n_audios)
+        c->is_init_section_common_audio = is_common_init_section_exist(c->audios, c->n_audios);
 
     for (i = 0; i < c->n_audios; i++) {
         struct representation *cur_audio = c->audios[i];
-- 
2.18.0