std/jpeg: ignore too-short COM or APPn markers

This commit is contained in:
Nigel Tao committed 2024-08-25 13:46:16 +10:00
1 parent 408ab25f04
commit 6a9347843b
6 files changed
+94 -5

No files matched your search

+5 -2
View File
@@ -49070,11 +49070,14 @@ wuffs_jpeg__decoder__do_decode_image_config(
}
self->private_impl.f_payload_length = t_4;
}
if (self->private_impl.f_payload_length < 2u) {
if (self->private_impl.f_payload_length >= 2u) {
self->private_impl.f_payload_length -= 2u;
} else if ((v_marker == 254u) || ((224u <= v_marker) && (v_marker < 240u))) {
continue;
} else {
status = wuffs_base__make_status(wuffs_jpeg__error__bad_marker);
goto exit;
}
self->private_impl.f_payload_length -= 2u;
}
if (v_marker < 192u) {
status = wuffs_base__make_status(wuffs_jpeg__error__unsupported_marker);