mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
In a multipart file the chunks start after the offset tables of all parts. The deep readers in craft-exr and craft-image-codecs took the end of the deep part's own table as the start of the chunk area, so an offset into a later part's table passed the chunk-area check and its bytes were parsed as a chunk. Both readers now compute where the deep part's table starts and where the last table ends with checked arithmetic, and refuse a file whose tables run past its end before reading any offsets. The earlier tables' sizes are no longer capped or saturated. Tests build a two-part file from scratch (a deep part and a 1x1 flat part, in both orders): the deep part decodes as in a single-part file, an offset into the second table or one byte before the end of the tables is refused, and a file that ends inside the second table is refused.