From 6d21aad1f9aabb434b4e0cab0e42dcfa2baa6e24 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Wed, 11 Feb 2026 11:51:59 +0900 Subject: [PATCH] [backport cloud/1.38] fix: handle RIFF padding for odd-sized WEBP chunks (#8795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #8527 to `cloud/1.38` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8795-backport-cloud-1-38-fix-handle-RIFF-padding-for-odd-sized-WEBP-chunks-3046d73d365081cc85bae4ada8541965) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne Co-authored-by: GitHub Action --- src/scripts/pnginfo.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/pnginfo.ts b/src/scripts/pnginfo.ts index 58fe2da0f2..d0b6ee3e4d 100644 --- a/src/scripts/pnginfo.ts +++ b/src/scripts/pnginfo.ts @@ -124,7 +124,9 @@ export function getWebpMetadata(file: File) { break } - offset += 8 + chunk_length + // RIFF spec requires odd-sized chunks to be padded with a single byte + // https://developers.google.com/speed/webp/docs/riff_container#riff_file_format + offset += 8 + chunk_length + (chunk_length % 2) } r(txt_chunks)