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

Backport of #8527 to `core/1.38`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8794-backport-core-1-38-fix-handle-RIFF-padding-for-odd-sized-WEBP-chunks-3046d73d36508174afc8cdd8cd791169)
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:54 +09:00
committed by GitHub
parent f741fb51e7
commit 94101d81d7

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)