From patchwork Wed Apr 10 11:26:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 12684 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B89A7447A77 for ; Wed, 10 Apr 2019 14:24:33 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9386668ACE5; Wed, 10 Apr 2019 14:24:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2088968ACE5 for ; Wed, 10 Apr 2019 14:24:25 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 04:24:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="141539811" Received: from media_lj_kbl.sh.intel.com ([10.239.13.101]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2019 04:24:22 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Apr 2019 19:26:34 +0800 Message-Id: <20190410112634.18597-1-linjie.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavu/hwcontext_qsv: Fix the realign check for hwupload 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: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fix the aligned check in hwupload, input surface should be 16 aligned too. Fix #7830. Signed-off-by: Linjie Fu --- libavutil/hwcontext_qsv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index b6d8bfe2bf..bc6236f25d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -892,7 +892,8 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, return ret; - if (src->height & 16 || src->linesize[0] & 16) { + if (src->height % 16 || src->width % 16 || + src->linesize[0] % 16) { realigned = 1; memset(&tmp_frame, 0, sizeof(tmp_frame)); tmp_frame.format = src->format;