Merge pull request #7410 from Carlyle-Foster/master

fixed negative read bug in core:image/jpeg
This commit is contained in:
Jeroen van Rijn
2026-08-21 11:26:14 +02:00
committed by GitHub

View File

@@ -247,7 +247,7 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
if slice.equal(ident[:], image.JFIF_Magic[:]) {
if length != 14 {
// Malformed APP0. Skip it
compress.read_slice(ctx, length - len(ident) - 1) or_return
compress.read_slice(ctx, max(0, length - len(ident) - 1)) or_return
continue
}