[backport cloud/1.38] fix: handle RIFF padding for odd-sized WEBP chunks (#8795)

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 <cbyrne@comfy.org>
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Comfy Org PR Bot
2026-02-11 11:51:59 +09:00
committed by GitHub
parent 6b4334759f
commit 6d21aad1f9

View File

@@ -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)