From patchwork Tue Jul 23 09:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Devonport X-Patchwork-Id: 50705 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a742:0:b0:482:c625:d099 with SMTP id f2csp2512333vqm; Tue, 23 Jul 2024 02:51:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBBGvHAVN5PFBRE2mzawQATlYHKf8wOy3Xc+tHHhvcvRcih2m3BHuRAlLaSTRt//CY04nCCtCvEDy0yvjGwLWEpwz1nOEhAAF3mg== X-Google-Smtp-Source: AGHT+IFIzafzSzg/Yj7HQ4JWf8odHutPrmjfpLpxVV7/GyBp6loJfmJ74Bx5jHUR2A6WleHgoWKi X-Received: by 2002:a05:6402:2553:b0:5a3:c00c:eafe with SMTP id 4fb4d7f45d1cf-5a3f089da5fmr7126129a12.23.1721728311044; Tue, 23 Jul 2024 02:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721728311; cv=none; d=google.com; s=arc-20160816; b=Oy1uEUMB5P0RRu9nLjy7uihaKCco2DuSKoIV7y+vuW/yOGIhQaJSS8R+cQxjCXRpB/ DIJXrgi/KQDnxGwFrlNPA0bkDQFX0X9752L8OstUI7JqlZ3HDyAJbIDV0hhKbeI7lx37 lIJttFYzxZnIGLWPP9fYKdM7P/vN9piC0PxVNYRdVq4BTgzgwbqllDujR3eY9R+FomH+ vicrPGA2vu35Bp9TS1O5r6lZLHu3NLeeVLvfFmV3F12AX02QDNUTwYHKY2zVOVG+oaYH 65NJ/dmxiiNXjbZ9CwfMulycow9iiDpgkcXKUT8r9Y1GAVRr2JQev5scerK15fIDVFbG WZ7A== 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:to:date:message-id:mime-version:from :dkim-signature:delivered-to; bh=bKK+mOvZcp77ZkrM0w4PV1xYLhiA3XpSkXqGPQbPfzg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=HOjPBY304U3SSdtkp23pqVWZ8iEgFJJa4ZEy05fXkKBLYk7DnjNmg+IXEicpG5oIot lpNpl7YS1c3CvOeDZ+w6Ywro3J3wbkvwtRfE/ESstkCuOi1rHb0Kl98oTjl+2W9O5fg0 hTXdmJqdyvXNi5GeJiOiSKCxuepDzQhALiANfYjVvPQj1q/2grVUg+/3fqAVRSp9GiNH FWfjQS5FF2G0NXMCRM3TNpTuU7cAKfWXQUarvWrkYEbOgN5+sfp2GrYrTSQfPOcK+Qgl WMY2ivoxzZ7YpAHJPgCx7ecvqW4uF5V0tFFz336eWMbb0tEAqCAeDswZv7RBbUYHksR4 N87g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="KSjxL4o/"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5a30bf10ec0si5742025a12.321.2024.07.23.02.51.50; Tue, 23 Jul 2024 02:51:51 -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=@gmail.com header.s=20230601 header.b="KSjxL4o/"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5708A68CFDA; Tue, 23 Jul 2024 12:42:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E48BE68D454 for ; Tue, 23 Jul 2024 12:42:36 +0300 (EEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4266dc7591fso38068625e9.0 for ; Tue, 23 Jul 2024 02:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721727756; x=1722332556; darn=ffmpeg.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=0KfwmOk+b+QbDHTJ6sYL2NWRqUt0qzId7+DJgWDG9Ok=; b=KSjxL4o/KZ6ctlahj6TFsAlcDve9Ttr/0aBiztyxwXQfH7hMG5b2gcEQuHPpS57ZSC xLuZmeWqQJwFJxY474702FtEUP53YhHA0cCWgfB3q5QK8BFcXEKj4uw9SbMAaQAM+3UO hw4bw87+1u21yjrCJtkvM1TU9kb+ixX+Yr7wHvSZjf8b/JTPr8PsdE5IDxUCa201YfLx oj8ZvVlcnmwMNws8fXGEp9m//OXwyfHTn1lRth5tbXrp+/6kGfmHzANsFBcyzb90GB9e F9zpqc0JjyKPowbqGPPk+7GQY+V8Xz/D3ZVfLfvHEkKWZHvQ5AMtucWgeyldtscWYwUr +8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721727756; x=1722332556; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0KfwmOk+b+QbDHTJ6sYL2NWRqUt0qzId7+DJgWDG9Ok=; b=wwj/1bNBTxNhWQgRS3UProQMBTXLfs02F7pwx4ytcJX8Pi+Ib08Gr2Dizb0jsiNqu3 gkQTWYucJ5cA9BzB+q6LmKOoL6WK3RxwFbsNeI+1n3UOvtm09TVVqEjRLT6lvTl1fqur dlY4V+pdwymwOA/q0yN0TzIRrFkbXaQeabiDXJW140JRcuLP1PWs73OcieesfKSHu5NM oAEZqFnq4AdkSAZYjCa5zHRyBTSEwlud+4m15EJKnCumN6l9HbL/w6FeR/V/RLeic2T1 5rfR+fwv1BzwGIL9583wnqFNd3fGary5egXmyPvvyq9vSQ1QtyhPnv6mvo+AWcZsuiVh CfVQ== X-Gm-Message-State: AOJu0YzWJclNBBpLgsfQe+8xqM/BEvEUPLt8NQKXC8+zQD2PdEVWFGiX Jwuj7kFFaZP0gRKnkO73VkuycILItA5uUnGaHtNvYTaaEPV8XvAcWmfi1g== X-Received: by 2002:a05:600c:3d8a:b0:426:5f75:1c2c with SMTP id 5b1f17b1804b1-427dc5482e6mr52905785e9.11.1721727755550; Tue, 23 Jul 2024 02:42:35 -0700 (PDT) Received: from smtpclient.apple ([152.110.31.183]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36878684757sm11033453f8f.10.2024.07.23.02.42.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2024 02:42:35 -0700 (PDT) From: Sean Devonport Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Message-Id: <50391908-1EB0-45C8-A476-1609A645D0A4@gmail.com> Date: Tue, 23 Jul 2024 11:42:22 +0200 To: ffmpeg-devel@ffmpeg.org X-Mailer: Apple Mail (2.3774.600.62) X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] lavc/exr: decode_block() fails when input resolution not exactly divisable by 8 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: /agmREZ+zFPQ This stops decode_block() from failing when the .exr resolution is not divisable by 8 (e.g 108x192). The dc_w and dc_h needs to be round up and not down. Signed-off-by: Sean Devonport > --- libavcodec/exr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 4bac0be89b..5df2c55609 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -987,8 +987,8 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse int64_t version, lo_usize, lo_size; int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size; int64_t ac_count, dc_count, ac_compression; - const int dc_w = td->xsize >> 3; - const int dc_h = td->ysize >> 3; + const int dc_w = (td->xsize + 7) >> 3; + const int dc_h = (td->ysize + 7) >> 3; GetByteContext gb, agb; int skip, ret;