From patchwork Sun Sep 18 11:46:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 614 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp534814vsd; Sun, 18 Sep 2016 04:46:22 -0700 (PDT) X-Received: by 10.28.15.194 with SMTP id 185mr4857967wmp.58.1474199182332; Sun, 18 Sep 2016 04:46:22 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ju8si15301975wjb.191.2016.09.18.04.46.21; Sun, 18 Sep 2016 04:46:22 -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=@rothenpieler.org; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39F7868A054; Sun, 18 Sep 2016 14:46:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 15A76689CDF for ; Sun, 18 Sep 2016 14:45:59 +0300 (EEST) Received: from localhost.localdomain (ip4d1666ad.dynamic.kabel-deutschland.de [77.22.102.173]) by btbn.de (Postfix) with ESMTPSA id 8E00E18DEE; Sun, 18 Sep 2016 13:46:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1474199172; bh=nIR8mtbpmgUBfeTOYOID12lO6lBuGNJR3LFGVvY0uz0=; h=From:To:Cc:Subject:Date; b=FiWUDlpNlm7fGqs+vuW1BWvnPqgVnxgQjnbtS+BKUaHovlaK5kUE8lheaC96YlcQJ cw6rCafvj/2S9xLLYmeO/W5ykFvyezBVGD5nkX/JG8uAxXwU51lPl1/zR/irCHBlt/ z1eHxtZESDaEJ9j5WJ027QA7VvLIsO9e+BtAU8zM= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Sep 2016 13:46:07 +0200 Message-Id: <20160918114607.25944-1-timo@rothenpieler.org> X-Mailer: git-send-email 2.10.0 Subject: [FFmpeg-devel] [PATCH] avformat/utils: only call h264 decoder private function if h264 decoder is in use 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 Cc: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes a crash when decoding with for example h264_cuvid, as avpriv_h264_has_num_reorder_frames assumes the AVCodecContext->priv_data to be a H264Context. --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index d605a96..06003dd 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -935,7 +935,7 @@ static int has_decode_delay_been_guessed(AVStream *st) if (!st->info) // if we have left find_stream_info then nb_decoded_frames won't increase anymore for stream copy return 1; #if CONFIG_H264_DECODER - if (st->internal->avctx->has_b_frames && + if (st->internal->avctx->has_b_frames && !strcmp(st->internal->avctx->codec->name, "h264") && avpriv_h264_has_num_reorder_frames(st->internal->avctx) == st->internal->avctx->has_b_frames) return 1; #endif