From patchwork Tue Jul 31 15:52:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Jendrzej X-Patchwork-Id: 9851 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp5378897jad; Tue, 31 Jul 2018 11:38:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBHSftjpb+O9/fxjCnpH6lYOKXl4fkOv3C3vRuQQVt2OstaIhRQFqHoIPux7obA0og8+ax X-Received: by 2002:a1c:9215:: with SMTP id u21-v6mr555196wmd.106.1533062301533; Tue, 31 Jul 2018 11:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533062301; cv=none; d=google.com; s=arc-20160816; b=LIrgmlhFUlIKpOsDphYEZCJwtstWhDMv0gUdHAPypm4Y8pokXPUr/OOUkrYm87wYdk 0BCqwZI4zJxeqE/qf0Clal2UVa2e1/0ewSAeXOGhQWjXsS6i5QTAOpb6axcA4yWLgwul MtoeOdAolbTjR7eiqwIy8x/CG8rPKE7I54JuJ1FDswsOlFOYGAmCcV2+mvDDJWz/YvDU ASA4cFm1z8iOLlGZ87maPscB5IVIde68r2c/HOr/qKKZ351zq/GC2sG4ohwdDo06MtRU Cc2/XSgOq975FkowTLghe6yBwRyZ/CSTV5NTf73sjH6MDXeRAaxQJ4EDN83tNq2dpDlL qo/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=+R9LyqN8CibP7BPiijgAl//0N2nUnMbASsWw2zXh6pU=; b=0t+WU0iA3Ti6yG9iedcQ2UnDD0oKDeMQ4DmspLttthVMa1weJQOsR/23g/tvWZc0l7 nq73rRzWsDc+pkX1jLqMUBpyYpY5hZ5IEqosGG6NmWmsh1L5K1xI4y/YEiXoymIyp46h N0+EXKEhuawE7U64tc0REuim91hndPdFs1m06WhMg6RN5MvleSmi+umP7gSvQUXD3X22 lIOt0n2PlujPLteODmDRQGnz1ozOxfGHVRRS+hqiNQsPC1KBzjOxkFH5R+sFrtfVnuY9 Df5LbhfAMPXQFWtLsgrpzv9z7TYMGyzrwKHHIeXgp4gSJc5QuhfnEbH3ldMZBRounVOE VmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ZfPVxsVJ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x10-v6si2084325wmg.5.2018.07.31.11.38.20; Tue, 31 Jul 2018 11:38:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ZfPVxsVJ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C11668A426; Tue, 31 Jul 2018 21:38:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 47F2F680C3E for ; Tue, 31 Jul 2018 18:52:37 +0300 (EEST) Received: by mail-io0-f174.google.com with SMTP id q19-v6so13412330ioh.11 for ; Tue, 31 Jul 2018 08:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=U1k2VJc759wfGpS1zsEu8mZy3O1oSQ6+/YkVYPjhPNc=; b=ZfPVxsVJQtam7pXWqxvIIjGkfNewT/p82dxmlyDPL+1JGi69Vngi5edas+hGuxlwfo IGBoOUb6Z7UWRxqWjKJrJ/bgUae9B6IhsFKtwUe8UuMdDTrMf9fbsl0qvONStVnUPFNV sTny72FKK6pWF/3C9Wh1UeW6apHXp0fphBFKoh1yVMYyND2k5Vkgx+dhEphCtWw6W1z0 vmol4oTpW8i0eLd6L8BkCr/EqyFvtp3xzXJzq749h75bPiesqIYjoVTDQSWtNK/sy/70 7XvNOBzAuxNBHtwmdVPL1+jHKDjAxMZiWH3owifJTAVO74bjcVS96YwFIdljr9QfnZcV bWEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=U1k2VJc759wfGpS1zsEu8mZy3O1oSQ6+/YkVYPjhPNc=; b=UBS5NgOdW8BAS5Ul3dviyfIfrPJZ1PWpyG0KwYRmkt9wIRu7X8AFjKYez2PSoXrvKx b7Qq0qegsLjQKTYBc+bR+5SNdQxLsRJ87dftpHSh5/Aa1hjBZP3E6Zq/QXRorUCAkD88 XxgqYz7uTbRUWFHC8y6/o0qGmVc+TkLebJNA/1O5uztTzmxVXvyKpNqK5EHiiRvDN2jk q6Ff6SifMSlPWTkJlkx111n5iM0FpayxNwlUUvshoI3RvNjMU1r4m0mVAdBp1QYZP8w/ Ygyt9SkR5oz/rHXYgaU98a54jTAZPCiZhP5v+mOMrPXdvatgtMS51rK56QxnaiB5T03X KC+Q== X-Gm-Message-State: AOUpUlHTgoQK+bWXngo9XXW+v4HF/VnrAZDmEa/uplZC7LmsjGRCapHz Gqg1lJSi8P6F436Rs7gOg7ek1A7Ur8DdVX1ss526yUxm X-Received: by 2002:a6b:450c:: with SMTP id s12-v6mr204277ioa.273.1533052373336; Tue, 31 Jul 2018 08:52:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8803:0:0:0:0:0 with HTTP; Tue, 31 Jul 2018 08:52:52 -0700 (PDT) From: jacek jogo Date: Tue, 31 Jul 2018 17:52:52 +0200 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Mailman-Approved-At: Tue, 31 Jul 2018 21:38:00 +0300 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] avformat/dashdec: fix for ticket #7336 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi. fix for ticket #7336 From a8948069bbf8995414bb20f578a1553c522b5d06 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej 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