From patchwork Fri Jan 19 05:05:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 7344 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.156.27 with SMTP id q27csp387507jak; Thu, 18 Jan 2018 21:07:51 -0800 (PST) X-Google-Smtp-Source: ACJfBovOoskvpVHaUrxVRj8+0/vB290hX/nF/W0uGKpRjmvFgNRUrHhudCEUYSQEkM/sWoo95qS6 X-Received: by 10.223.191.15 with SMTP id p15mr8022729wrh.76.1516338471393; Thu, 18 Jan 2018 21:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516338471; cv=none; d=google.com; s=arc-20160816; b=CXUEmyRaLRhjnB9Vn/Wh+ENzUMMiiCMcCN/yTyrREXrsd0m7vtnRC/j3wfDJriceTM bmTRvmP/VKK40e0RpLWSWrmWWKOCunD7NVyjacrjLTjht/BxuRJwoon1RxjU5WfTSs0N N9bsuv5vGfntNwBJ1N3sPJvLK9El9KOkz8DAqupDkJ/90aiT2HcYo/Ge+cl1Qbhcgf+5 qjY0mscNMjFLXVb66k5Yr/0ogVcZMFM/DX3DMnjs0k9Jw0ZYe6JDFujm2pPKjCMXk8M/ uqB5rSE5dlX4SFPOV6ek+p4reDldJJMVk9lA0YXkFEpomeFeIuLqmXuqw8lYJrXBvseC c1KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=IXNj6PJfPLp0IngAjZjCmYcZ7Yxc9UZC/sLAw5r54aQ=; b=tDvILSz5Y7JtNEJSds/yLo3I48um5LthCOK9UaZbYSv/AbvIyBvroWsULBq/V8Jzn4 tNCXCQewtJ7LFWmSGho1tVLMnm9tgDR5ky8oo9mBPdx514h7a0tB369rDg6ZSvjtCJk9 OhRlSBoadCH5s5p3QwotZKGLuW7rJML8XK+lNqIRbo/EeFZKAAtRCmcrffPhRwLwdnHe wpDLD7NY8FZQlATMUwbLo2cOodYyeUG8tJwIB4xkK7+/Ph/QnUEBjb/v/8vaFe3S27I/ XnbTf9ArViZj30t2UP147oXWk5v0BohZCOeyxC19eBqa26T4GUio7sqvGnrHzueLXF8Q EmIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v6si416811wmc.130.2018.01.18.21.07.50; Thu, 18 Jan 2018 21:07:51 -0800 (PST) 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; 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 DC8ED68A33D; Fri, 19 Jan 2018 07:07:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D98E680284 for ; Fri, 19 Jan 2018 07:07:41 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 21:07:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,380,1511856000"; d="scan'208";a="196823925" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.18]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2018 21:07:39 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Jan 2018 13:05:55 +0800 Message-Id: <1516338355-1976-1-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH] ffprobe: Initialize coded_width/height 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: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" coded_width/height are unnitialized and will be overwritten by dec_ctx->width/height in avcodec_open2() This fixes tiket #6958. Signed-off-by: Zhong Li --- fftools/ffprobe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 0e7a771..233760d 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2512,10 +2512,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id case AVMEDIA_TYPE_VIDEO: print_int("width", par->width); print_int("height", par->height); +#if FF_API_LAVF_AVCTX if (dec_ctx) { print_int("coded_width", dec_ctx->coded_width); print_int("coded_height", dec_ctx->coded_height); } +#endif print_int("has_b_frames", par->video_delay); sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL); if (sar.den) { @@ -2912,6 +2914,10 @@ static int open_input_file(InputFile *ifile, const char *filename) ist->dec_ctx->pkt_timebase = stream->time_base; ist->dec_ctx->framerate = stream->avg_frame_rate; +#if FF_API_LAVF_AVCTX + ist->dec_ctx->coded_width = stream->codec->coded_width; + ist->dec_ctx->coded_height = stream->codec->coded_height; +#endif if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) { av_log(NULL, AV_LOG_WARNING, "Could not open codec for input stream %d\n",