From patchwork Sat May 18 03:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48973 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3253244pzb; Fri, 17 May 2024 20:58:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUoO9ClTg+8BR16VjpXB/+snoaXjuH4kUeiAJzJc+rMje6oW4q/havX1b9ji+bJl8vjbXPv6faBj8G9NXx6qkUSoXoX0LdRGDB2FA== X-Google-Smtp-Source: AGHT+IE5syme5jEIc4h8kj+JZCh0E59DQb4CVzXsIrr/ZUWnwFKhBfA3NNtRwLIwVoK6EqOyLOZ3 X-Received: by 2002:ac2:4982:0:b0:51d:3fa4:e997 with SMTP id 2adb3069b0e04-5220fc7ef8cmr15046273e87.33.1716004698754; Fri, 17 May 2024 20:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716004698; cv=none; d=google.com; s=arc-20160816; b=BwApBzoDInJD3XtwmseHChtw33/x/EKZ/SwyX1LHzM5m4lUhGiSiPwm52HqRybmUjP yN7hJiq5CygK7GnWGmmNEm3s0tUAqbsqIJTV2iJZ8iXL4Q1aE9ngCZcOXMLhRDigLRFc 9HRd0Y9fNv8F+HnWQc8dWkP+iUubApKclxCuch5uEE1Z1KRXIy5hiJpy0j+QIwAYAoaU 2uZK8bJi3YFtSOieFUpHDljZppZH9s05jJ942St7Kvjzz6HmHOCAjhN/UpHBBMoiIi6Q 2oyV30W7y/r1567QMcH+ExDHDP6BSsbPnRKrTddVwbjyOIFnbUexdNRMcd0PVAgm2i2M srNQ== 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=ZUuJSO0sv3jKrU3/RoyFp+x0iL+AyqK8bEaPiAcXqj4=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=ib+r3EupunzOjOQRpOOsjulnRXHugUK97X8R6iN6M8ctlh4XAIoyzBBVxgWoAZzSQl wU04Bmgkbhes8HlYcXjME/w1tB+BXNeAiMQxn4/BoVSBTBWTwyzt0GAarfgwaTDxwqn6 NzxY7ihnSv8AEX+XYN5DoaQQkw5SJ0wQ1n6e6rIcEyJjjkilOG56p1lFFUjWbLwjqP75 tW0WisM8GWaKW5WPBKEpQIdT5ui6U6P4VYwxNfWHW5F5Y2dY8Ab4PsuyS9EfF0U6d7ZX FZweK4oqa+LaG7H0VkDyvutShIgYlzoaxxb1KFiRpoMqxqVRGWgJ+qqObjXBQiMEmKvm X5mA==; 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=pyp858EH; 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 2adb3069b0e04-5222f6e2ba7si5336809e87.516.2024.05.17.20.58.18; Fri, 17 May 2024 20:58:18 -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=pyp858EH; 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 3AF3068CF68; Sat, 18 May 2024 06:57:56 +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 8119168CED8 for ; Sat, 18 May 2024 06:57:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AA146240003 for ; Sat, 18 May 2024 03:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716004666; 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=T5eR8UvAcPr5sPbvVt/HJsD73WJ1JzfAwpJMvt2iyLg=; b=pyp858EHYn7B9iHYIkv5As4a2VhUnqV3/Ci3es91v7xhSFWVMCsmuXoK1DbBFtAN8XzNHG UdAgm3kA5BCU6fWqxagcrN65kqwMzEUADvkoXl92s35tQM2keQQZbvtN5nuYF545ZIHIH3 ypBibAWCvEDskf6gXUuM4bsWfQd9C2U/Y7V9iams/1rclGAof0FR4Ou4ZkSWeRchZyLU8C o2ZoYNu68TA5uZkNb6hGuMK7sJRYm3TEqzrlfC5oxrK+0hjwGYJwITbQYdCl2in6JSFIW8 poywkygkwFDzORJk0ptyGSkFMLwJPPwklEvgAyspLbjavODaKFuI5G6T2qxKSg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 18 May 2024 05:57:37 +0200 Message-ID: <20240518035743.766552-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240518035743.766552-1-michael@niedermayer.cc> References: <20240518035743.766552-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/9] avcodec/vble: Check av_image_get_buffer_size() 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: bDaUX+/RqZ3v Fixes: CID1461482 Improper use of negative value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vble.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 32157913c77..c585b1ed9fc 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -191,6 +191,9 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) ctx->size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); + if (ctx->size < 0) + return ctx->size; + ctx->val = av_malloc_array(ctx->size, sizeof(*ctx->val)); if (!ctx->val) {