From patchwork Thu Mar 9 12:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 40621 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp306723pzb; Thu, 9 Mar 2023 04:57:31 -0800 (PST) X-Google-Smtp-Source: AK7set8fiq8XhFhzZrctpFhtYCoZyrDccKv43uLd7EcUA6QgLCgw0aMSmTTlfDHM2gsEzyd0qdNz X-Received: by 2002:a17:907:8e91:b0:8e3:da5c:56f7 with SMTP id tx17-20020a1709078e9100b008e3da5c56f7mr22471204ejc.76.1678366650951; Thu, 09 Mar 2023 04:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678366650; cv=none; d=google.com; s=arc-20160816; b=Y1Bnsx5Z0+mS1AL85z0RQp8Pz21Vn9NhACvLpP2VszpOovrBNTX92PCdeIABB9Nwn2 gLz5WDf6+A8uxUc8Ss0MW6iEFLK/9oVEclEgDB6WZ8bWjy92zcRGbt2dKCfAuB1rr/jJ OG/++DXkwguE541V4Pdbd4LwP3VwZuL5lFskfGHCE9lZRhdAuEYGuV6mszcq3fyHRlH7 0WRpAv3hUokarHFpXHkwDFXfST1iOQXBwlbyRg6+2ZKXN83XfjF/VwfQ6TmHPCaTveeW 1BomYw2n7YeiiwTky9b/KpQ3ZXlmem6D4ae5/0uadmo+u4No/uWupI+ozRh5aPxZWMVc i3Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=CCvTx/JPnA3TLKGVWGQtR0AfDMSQ3QOB/567QsyUGI8=; b=e/Jr6vp6fKoNN/gfN+NhksJ48zWo1XfJ0gcoOyLk4MMayT5JljAGiFlLcRJnwi60xC 3hTYc0IV7kkWG3Y4nHEih250D739yonkqY4MMTT55B6uQMUUvndN15qBaSP16joB9FJR jxXArd+dLAVItbmj+HILz9qy+83qrDXH/RAFxahswNcED3MDU3+GeU98c7t2A+ccAx/y ib3GzltJbQ/QGjrXgchLRnAnGQRSz2mh+ZGmzNE+91ebkxaxQZmWYCWGkZRGMOMh35DZ FhxK0TCoXAd18bTIjpON3Ezi6hfAMuMBi/uL0nFRojugZQu693BVUx2mOQ1SUWlvGtNT TFiA== ARC-Authentication-Results: i=1; mx.google.com; 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 w1-20020a170906130100b008dd491949d1si915074ejb.198.2023.03.09.04.57.30; Thu, 09 Mar 2023 04:57:30 -0800 (PST) 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; 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 C190B68BCD5; Thu, 9 Mar 2023 14:57:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C97AC68B09D for ; Thu, 9 Mar 2023 14:57:19 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id A895860015 for ; Thu, 9 Mar 2023 12:57:18 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 9 Mar 2023 13:57:14 +0100 Message-Id: <20230309125717.29821-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/4] libavcodec/lcldec: width and height should not be unsigned 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0DoSOkVISvEN Computations like col < width - 3 will not work with unsigned width=1 Signed-off-by: Michael Niedermayer --- libavcodec/lcldec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 5cc0a29bcd..95206eeb69 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -169,8 +169,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int row, col; unsigned char *encoded = avpkt->data, *outptr; uint8_t *y_out, *u_out, *v_out; - unsigned int width = avctx->width; // Real image width - unsigned int height = avctx->height; // Real image height + int width = avctx->width; // Real image width + int height = avctx->height; // Real image height unsigned int mszh_dlen; unsigned char yq, y1q, uq, vq; int uqvq, ret;