From patchwork Sun May 19 02:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48997 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3719382pzb; Sat, 18 May 2024 19:49:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXbUn4zlFaWYvSKehaQWy1/IwehufxqotKghsWX22SPjENCbRn7seLvCstf9TJndKdpYCCWO41HD5Ck4KJhhuPgtMl2Gkno38yCDg== X-Google-Smtp-Source: AGHT+IHWn3/DktB/fc6eKhtTxT9dVHiNbfnm2GvBBYrefjV2+8KUBLTKPQkfKNrpkt03MzNkuTxU X-Received: by 2002:a19:385c:0:b0:51f:2ae3:57b4 with SMTP id 2adb3069b0e04-5220fc7dd16mr14940253e87.27.1716086969008; Sat, 18 May 2024 19:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716086968; cv=none; d=google.com; s=arc-20160816; b=io0vOpZxx369FujjBYLJpWwbdpCD0Z33W7P07h1fP9jvDN1RcIcwMPuCp/7Q8z4B5i pV7n+Pox3wIFv6Gh5azgM8tlQ//HxduVFda02PBjJ6Isszp3WhHhB0ASO7WZMBbt71uM 4QA+/3k+l2HvomXfb+8jEiO2U/IqFHQBDKNXOq7w9R60F2+i+9EUJhuQ/6WPt/F/hzOt M3fr9gqnl06D3ClewqXAsYZVqDAxbtex+ThqG2tu9ZGwilpPDqc9W9Nvo3mfL5f3vgk+ unybj3JTcE5Bul9S9hWJh31HuqYsYdMp8PVgRkHwSVNq7+jDQ2WeXqS7MRlyUe+v8KpN TSaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=99/6LaJ57kY8dMGE08HbacgLWYqMwTnaGWTg4jsCXsg=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=rgg5k+61ELPaywyH6PjwHvYJ+FrKKjx2wL8I/5CwMDlZJXxO1Ocn6EWEFjQ5fVY/sn SquXbtKlNWN/9o7UIZqhH+nTT3378WYnbXUbX2N82Et+a+6PV4AwW4IyOL0uFkHhRB8D iwMFM2Mz9nx0GgEyBMN1XM9PZthg8NUyrG51FCH8NDhhMeK2tKMYO2427im6B3tsJfTN iDsTXJPsGmoiWPdLzOWqAKYBNSLvo3q2lyU/ew0AiOfrfK07RK/GErh95nXhYzhQoWPM 6boEMPEDNyYN3VZvnbTSnblVUS1LucYzs0r0fmfzs2nI4kQ0mnnhwVKY0wHEW8TUpgn/ IzQQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=MMDBYGcc; 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 a640c23a62f3a-a5a1797a3a2si1144456166b.212.2024.05.18.19.49.28; Sat, 18 May 2024 19:49:28 -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=@niedermayer.cc header.s=gm1 header.b=MMDBYGcc; 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 A078468D150; Sun, 19 May 2024 05:49:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B06068C4C8 for ; Sun, 19 May 2024 05:49:17 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id F364A240003 for ; Sun, 19 May 2024 02:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716086957; 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; bh=ZWVb/tFEUpGMnFjC/hagQC5r7iTmiItW3uJGyn82kPE=; b=MMDBYGccD7yaMpFMZrTxpvEwDYeW6Jri95uVJWnXJF8KtPQCOuZGMdZ4WVD+S5ZoAPUDNF ix5fy2M+AoTueiynx31PAtoYNuhvMx+5i4MUowdqwddek5lbmuOFADttf4a1jAuXMw1Rcj hfiMa3v8cuBXvZbSxRj+fc8vu3hkOtU9CTMcpSlry6kB4Q//0rzc3JqzlerBMcCnpA9teN XAzR5Z1+G2HqIr6QZPjuEKTyi758m92skbu7K9NAKsI9w+zbPUeqSCh9bEiGZNxo9QWDqa 2IDA9WYBh7CZpsfYajr9di/TwLhtOkRcbPRMCM3mtXvU/5GrcgTPWKv1jc6cyw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 04:49:07 +0200 Message-ID: <20240519024915.1944150-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: eEe64fhKFBko Fixes: CID1516090 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vqcdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c index 5c6cab3c1ab..bb69844327d 100644 --- a/libavcodec/vqcdec.c +++ b/libavcodec/vqcdec.c @@ -147,10 +147,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid GetBitContext gb; uint8_t * vectors = s->vectors; uint8_t * vectors_end = s->vectors + (width * height * 3) / 2; + int ret; memset(vectors, 0, 3 * width * height / 2); - init_get_bits8(&gb, buf, size); + ret = init_get_bits8(&gb, buf, size); + if (ret < 0) + return ret; for (int i = 0; i < 3 * width * height / 2 / 32; i++) { uint8_t * dst = vectors;