mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
std/jpeg: halve maximum scan count from 64 to 32
cjpeg defaults to using 1 (sequential) or 10 (progressive) scans. 32 is
still easily more than what's seen in practice.
The previous commit (f9c384d6 std/jpeg: add "expect multiple scans"
check) makes Wuffs more closely match libjpeg. Without that commit,
though, this commit halves the time taken to decode the oss-fuzz test
case (linked below) from 6 to 3 seconds, in an optimized build. For the
debug-sanitizer fuzzer build, without this commit, that test case times
out after 60 seconds but this commit should halve the time taken.
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70340
This commit is contained in:
1 parent
f9c384d6b2
commit
42b070e487
2 files changed
+2
-2
No files matched your search
@@ -47714,7 +47714,7 @@ wuffs_jpeg__decoder__decode_sos(
|
||||
switch (coro_susp_point) {
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
|
||||
|
||||
if (self->private_impl.f_scan_count >= 64u) {
|
||||
if (self->private_impl.f_scan_count >= 32u) {
|
||||
status = wuffs_base__make_status(wuffs_jpeg__error__unsupported_scan_count);
|
||||
goto exit;
|
||||
} else if ((self->private_impl.f_scan_count > 0u) && ! self->private_impl.f_expect_multiple_scans) {
|
||||
|
||||
@@ -1257,7 +1257,7 @@ pri func decoder.decode_sos?(src: base.io_reader, workbuf: slice base.u8) {
|
||||
var decode_mcu_result : base.u32
|
||||
var bitstream_length : base.u32
|
||||
|
||||
if this.scan_count >= 64 {
|
||||
if this.scan_count >= 32 {
|
||||
return "#unsupported scan count"
|
||||
} else if (this.scan_count > 0) and (not this.expect_multiple_scans) {
|
||||
return "#bad scan count"
|
||||
|
||||
Reference in new issue
Block a user