mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
std/jpeg: add "#unsupported scan count"
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59540
This commit is contained in:
1 parent
0b18d43e4f
commit
5edfe45e15
2 files changed
+11
No files matched your search
@@ -8645,6 +8645,7 @@ extern const char wuffs_jpeg__error__unsupported_marker[];
|
||||
extern const char wuffs_jpeg__error__unsupported_precision_12_bits[];
|
||||
extern const char wuffs_jpeg__error__unsupported_precision_16_bits[];
|
||||
extern const char wuffs_jpeg__error__unsupported_precision[];
|
||||
extern const char wuffs_jpeg__error__unsupported_scan_count[];
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -36614,6 +36615,7 @@ const char wuffs_jpeg__error__unsupported_marker[] = "#jpeg: unsupported marker"
|
||||
const char wuffs_jpeg__error__unsupported_precision_12_bits[] = "#jpeg: unsupported precision (12 bits)";
|
||||
const char wuffs_jpeg__error__unsupported_precision_16_bits[] = "#jpeg: unsupported precision (16 bits)";
|
||||
const char wuffs_jpeg__error__unsupported_precision[] = "#jpeg: unsupported precision";
|
||||
const char wuffs_jpeg__error__unsupported_scan_count[] = "#jpeg: unsupported scan count";
|
||||
const char wuffs_jpeg__error__internal_error_inconsistent_decoder_state[] = "#jpeg: internal error: inconsistent decoder state";
|
||||
|
||||
// ---------------- Private Consts
|
||||
@@ -39484,6 +39486,10 @@ wuffs_jpeg__decoder__decode_sos(
|
||||
switch (coro_susp_point) {
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
|
||||
|
||||
if (self->private_impl.f_scan_count >= 64) {
|
||||
status = wuffs_base__make_status(wuffs_jpeg__error__unsupported_scan_count);
|
||||
goto exit;
|
||||
}
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
status = wuffs_jpeg__decoder__prepare_scan(self, a_src);
|
||||
if (status.repr) {
|
||||
|
||||
@@ -32,6 +32,7 @@ pub status "#unsupported marker"
|
||||
pub status "#unsupported precision (12 bits)"
|
||||
pub status "#unsupported precision (16 bits)"
|
||||
pub status "#unsupported precision"
|
||||
pub status "#unsupported scan count"
|
||||
|
||||
pri status "#internal error: inconsistent decoder state"
|
||||
|
||||
@@ -1147,6 +1148,10 @@ pri func decoder.decode_sos?(dst: ptr base.pixel_buffer, src: base.io_reader, wo
|
||||
var stride : base.u64[..= 0x1_0008]
|
||||
var offset : base.u64
|
||||
|
||||
if this.scan_count >= 64 {
|
||||
return "#unsupported scan count"
|
||||
}
|
||||
|
||||
this.prepare_scan?(src: args.src)
|
||||
|
||||
// Reset.
|
||||
|
||||
Reference in new issue
Block a user