From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E4030404EF for ; Thu, 24 Feb 2022 02:27:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1C1B68B23C; Thu, 24 Feb 2022 04:27:43 +0200 (EET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D3D2868B210 for ; Thu, 24 Feb 2022 04:27:36 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645669662; x=1677205662; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=taemaApMoHP9l0Bnvtp1ER/svefhZz7gsV04R/zN6zg=; b=aDxskN1YbDBRssF1zZ0q+x4puTJAuOjzP8YmqrEJ7BgRrUnnN2ytb+Ne LPvB0gZ6Jbl7x6x775QJmx2rgjwbvtbwqRfWeZapcbAywhMWss4mRnJI7 0HwHLys6MPlfIWRaxbuBPmovtcXXROTvdoLNCOW0sBomWdd40cYXUGJ1o y016Ylf+ok60DQm5QDqwHAgfMyi5b5uR0mHSbHv6bzoEdQW7Gr76K4IOC MKl2fqZgIRqQgKXDl/fy1kyBrNa5TrMNMBsTbkPgOPtcLuxi/cNZm7uUi RNhW6jWNwrLNP3FMj3XWImxr8jaljfBYBF9EcZUuYR31mjtoC9CxFyB/6 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="276757132" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="276757132" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 18:27:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="506155193" Received: from desktop-qn7n0nf.sh.intel.com (HELO localhost.localdomain) ([10.239.160.39]) by orsmga002.jf.intel.com with ESMTP; 23 Feb 2022 18:27:33 -0800 From: Tong Wu To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Feb 2022 10:27:40 +0800 Message-Id: <20220224022740.58216-2-tong1.wu@intel.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20220224022740.58216-1-tong1.wu@intel.com> References: <20220224022740.58216-1-tong1.wu@intel.com> Subject: [FFmpeg-devel] [PATCH] qsvenc: avoid dereferencing the null pointer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Tong Wu MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The variable AVFrame *frame could be a null pointer, now add a null pointer check to avoid dereferencing the null pointer. Signed-off-by: Tong Wu --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 07be4287b7..998e43753e 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1726,7 +1726,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, goto free; } - if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame->interlaced_frame) + if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame && frame->interlaced_frame) print_interlace_msg(avctx, q); ret = 0; -- 2.16.1.windows.4 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".