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 E9F984B4C0 for ; Sun, 7 Jul 2024 18:47:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C399368DA48; Sun, 7 Jul 2024 21:47:38 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4C15C68DA53 for ; Sun, 7 Jul 2024 21:47:32 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7D47BE0002 for ; Sun, 7 Jul 2024 18:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720378051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XG43tCmaKxmkZNYKh/ZQyQi+qieB94EfgqemmbUDMQA=; b=nFFc7DLNIyITkg/zPiRCqH1hk+n/GTONMR83rHFVcR+s1yCIXH/P2UIDh7cNOIJH5UINJv /++f3AfqdqZ4c7W826MHeRC5LNX0eN+uzpd09B2k2KGmy6u7Mu8JWAHPdpTQmOoUQP5Cas qpLSrcbE1IPoV4Yh+WpyqmW35qW+UT9dB+an3dVxgduEqT0RdzslrEqREvPolQ4IY6Eq1L 9Lznljq6FVUEeWWr9xvHCh8J69YQd3iJQ0K+qp/e1xl2PLVH5Mz2xCajjsJKCb8YM0VUOF n2cv3mhka67JmksU7DZr22d7VoeWH4z0BXelRFUoEZ4BwAa+fAaL3nEa1YUMiw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 7 Jul 2024 20:47:25 +0200 Message-ID: <20240707184729.3525852-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240707184729.3525852-1-michael@niedermayer.cc> References: <20240707184729.3525852-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/vaapi_h264: Do not store our error code in VASliceParameterBufferH264 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 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: I am not sure this is possible (thus this requires review) Fixes: CID1604570 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vaapi_h264.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 398e92568c2..77819a64a4e 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -342,6 +342,10 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, const H264SliceContext *sl = &h->slice_ctx[0]; VASliceParameterBufferH264 slice_param; int err; + int slice_type = ff_h264_get_slice_type(sl); + + if (slice_type < 0) + return slice_type; slice_param = (VASliceParameterBufferH264) { .slice_data_size = size, @@ -349,7 +353,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, .slice_data_flag = VA_SLICE_DATA_FLAG_ALL, .slice_data_bit_offset = get_bits_count(&sl->gb), .first_mb_in_slice = (sl->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + sl->mb_x, - .slice_type = ff_h264_get_slice_type(sl), + .slice_type = slice_type, .direct_spatial_mv_pred_flag = sl->slice_type == AV_PICTURE_TYPE_B ? sl->direct_spatial_mv_pred : 0, .num_ref_idx_l0_active_minus1 = sl->list_count > 0 ? sl->ref_count[0] - 1 : 0, .num_ref_idx_l1_active_minus1 = sl->list_count > 1 ? sl->ref_count[1] - 1 : 0, -- 2.45.2 _______________________________________________ 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".