From patchwork Sun May 26 23:52:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49287 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958848vqf; Sun, 26 May 2024 16:54:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWF/QzsHrS+JnyatJQVfa/I6PKZhFVKLqyufvkEuhKSPBiLUrp9cjkAjiQFwwMb8rkW3FGZoczjr9ikI2BogmLqJvnphLBGYLb3bw== X-Google-Smtp-Source: AGHT+IE95+dmozvbCQg8lSw6zL/z1L7/b1JsNf4hduvfNSmqrlVHcZZ8fzx8gtIBkQVnAviTqJeM X-Received: by 2002:a05:600c:3586:b0:41f:e10f:88b1 with SMTP id 5b1f17b1804b1-42108a99f18mr74757405e9.27.1716767653477; Sun, 26 May 2024 16:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767653; cv=none; d=google.com; s=arc-20160816; b=NQRCeLw+HBqsEOFBM6zSudq7yR/Sv7Gu1EsN04KXoWjCiYmPBA34SMPVio55tTVPyF PgNqPcEPYMUXD+AUQCakUzbs4vYEaoNW7TU3gxvO5Df68M95p9Lk5lPE6G7QwD+VELvN 3J5H+jYItMAR65/rOaJUDePO6HcwlIE3NRAUExn47bEjwIzV6O0GGzMnaQ+5GMuAAM8l X+KKTobfGMINOX0RxzRzDwFLwFBoik8P9LvptPeVPemhZOx1HvpAhkgrKzvei1glZtcf xqv6cyG3J755bZcVhWhybnVLaQtXG6n6dCgfiok0wGTCLs5dkYdBKbIpHv1l31/INMDM OZCA== 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:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=UHjxtHoZ/VNYhHlWzi1pWeC0N/dZ3pwJM8vLB9J9jUY=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=AEPOAy9FlaYt8LGXX8M4j17hk5kzKOmivuqBSiX57WIGTaw8DIyYA+GsJozDEeJOVr t/tLE6ruihFunGkUGzf4GsnaX1azNNv2lixeVqgWgGDpSSLOVKGbeQ9vz/UJ6XykUZzd O8ifY7+dA9R76x7z7MTmCtnfhEVAP8WCJi3C7DFlp70O7L9iZo/gTfh2KmCCwvN4/TtQ gwvmyfhea8h1WJr7XxgmnZDjcD3TrXxd+PDj6tgvBYsxLcz/vcsGywS+iz5KK8HzAEFW ZJg99pOPYUqjR3j3XQK8Ncov1wGO3lHIcFuh8t36RzEwxmjhvuqbk+hqUqWQIhB7kVxm D4FA==; 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=bjfFM88E; 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-a62892fd87dsi268722266b.759.2024.05.26.16.54.12; Sun, 26 May 2024 16:54:13 -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=bjfFM88E; 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 AAF6D68D1C4; Mon, 27 May 2024 02:52:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 A057B68D560 for ; Mon, 27 May 2024 02:52:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 02A2BE0003 for ; Sun, 26 May 2024 23:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767558; 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=C8WfrN4t85X9q39oZzdoAJine5Th0U7ukZV9c43y6D8=; b=bjfFM88EYYwyzA0iw2Oa/mDa9KrZ0SZSSsyR4BOwj6PBVSh3VJIDK/yI9G77u9UYdbuCV7 zB21GghR7aWFXVBeq6xuUw21o6W61Om96GtYH9XAkw+5gIAuRq6n9kd2eOcvAgkyWjJoLW 6l8u8/1y5Cg6i4kYFiixlUUdvsVqFTgVGKck6xTXjHTrsfovWdt+fzMxOq2xFwIWa9lGap BF+Ynp2xNpv+ZiPppYauL3RWO5bO/DogreEmmF0SALtHMhDhXrXQLt+Zo2GO2jJkzuu4bi PU3pc0gFklR7OZCDBAjFhhHMR1+z4UkebULHLjX14bGkbRb05e6A0asRX56T7Q== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:20 +0200 Message-ID: <20240526235230.2876318-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init 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: V+nqiQFbEFk5 Fixes: CID1598556 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vp8.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 8e91613068a..3e1f67172ae 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -247,7 +247,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7) return AVERROR(ENOMEM); } #if HAVE_THREADS - pthread_mutex_init(&s->thread_data[i].lock, NULL); + ret = pthread_mutex_init(&s->thread_data[i].lock, NULL); + if (ret) { + free_buffers(s); + return AVERROR(ret); + } pthread_cond_init(&s->thread_data[i].cond, NULL); #endif }