mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
1 parent
ef74175a20
commit
000b0a3445
2 files changed
+23
-47
No files matched your search
@@ -40795,14 +40795,12 @@ wuffs_png__decoder__do_decode_image_config(
|
|||||||
status = wuffs_base__make_status(wuffs_base__note__metadata_reported);
|
status = wuffs_base__make_status(wuffs_base__note__metadata_reported);
|
||||||
goto ok;
|
goto ok;
|
||||||
}
|
}
|
||||||
|
label__1__continue:;
|
||||||
while (true) {
|
while (true) {
|
||||||
while (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
if (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
||||||
if (a_src && a_src->meta.closed) {
|
|
||||||
status = wuffs_base__make_status(wuffs_png__error__bad_chunk);
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(8);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(8);
|
||||||
|
goto label__1__continue;
|
||||||
}
|
}
|
||||||
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
||||||
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
||||||
@@ -43201,13 +43199,10 @@ wuffs_png__decoder__skip_frame(
|
|||||||
self->private_impl.f_chunk_type_array[3] = 0;
|
self->private_impl.f_chunk_type_array[3] = 0;
|
||||||
label__0__continue:;
|
label__0__continue:;
|
||||||
while (true) {
|
while (true) {
|
||||||
while (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
if (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
||||||
if (a_src && a_src->meta.closed) {
|
|
||||||
status = wuffs_base__make_status(wuffs_png__error__bad_chunk);
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(1);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(1);
|
||||||
|
goto label__0__continue;
|
||||||
}
|
}
|
||||||
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
||||||
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
||||||
@@ -43446,14 +43441,12 @@ wuffs_png__decoder__do_decode_frame(
|
|||||||
goto suspend;
|
goto suspend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
label__0__continue:;
|
||||||
while (true) {
|
while (true) {
|
||||||
while (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
if (((uint64_t)(io2_a_src - iop_a_src)) < 8) {
|
||||||
if (a_src && a_src->meta.closed) {
|
|
||||||
status = wuffs_base__make_status(wuffs_png__error__bad_chunk);
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(2);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(2);
|
||||||
|
goto label__0__continue;
|
||||||
}
|
}
|
||||||
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
self->private_impl.f_chunk_length = wuffs_base__peek_u32be__no_bounds_check(iop_a_src);
|
||||||
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
self->private_impl.f_chunk_type = ((uint32_t)((wuffs_base__peek_u64le__no_bounds_check(iop_a_src) >> 32)));
|
||||||
@@ -43588,14 +43581,12 @@ wuffs_png__decoder__do_decode_frame(
|
|||||||
wuffs_png__decoder__filter_and_swizzle(self, a_dst, wuffs_base__slice_u8__subslice_j(a_workbuf, self->private_impl.f_workbuf_wi));
|
wuffs_png__decoder__filter_and_swizzle(self, a_dst, wuffs_base__slice_u8__subslice_j(a_workbuf, self->private_impl.f_workbuf_wi));
|
||||||
}
|
}
|
||||||
if (v_status.repr == wuffs_base__suspension__short_read) {
|
if (v_status.repr == wuffs_base__suspension__short_read) {
|
||||||
while (true) {
|
status = wuffs_base__make_status(wuffs_png__error__truncated_input);
|
||||||
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
|
goto exit;
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
status = v_status;
|
status = v_status;
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(7);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(6);
|
||||||
}
|
}
|
||||||
label__1__break:;
|
label__1__break:;
|
||||||
v_status = wuffs_png__decoder__filter_and_swizzle(self, a_dst, a_workbuf);
|
v_status = wuffs_png__decoder__filter_and_swizzle(self, a_dst, a_workbuf);
|
||||||
|
|||||||
+12
-27
@@ -241,14 +241,10 @@ pri func decoder.do_decode_image_config?(dst: nptr base.image_config, src: base.
|
|||||||
// IDAT chunk breaks the loop. The only other possible critical chunk is a
|
// IDAT chunk breaks the loop. The only other possible critical chunk is a
|
||||||
// PLTE chunk. We verify PLTE checksums here but ignore other checksums.
|
// PLTE chunk. We verify PLTE checksums here but ignore other checksums.
|
||||||
while true {
|
while true {
|
||||||
while args.src.length() < 8,
|
if args.src.length() < 8 {
|
||||||
post args.src.length() >= 8,
|
|
||||||
{
|
|
||||||
if args.src.is_closed() {
|
|
||||||
return "#bad chunk"
|
|
||||||
}
|
|
||||||
yield? base."$short read"
|
yield? base."$short read"
|
||||||
} endwhile
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
this.chunk_length = args.src.peek_u32be()
|
this.chunk_length = args.src.peek_u32be()
|
||||||
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
||||||
@@ -1053,14 +1049,10 @@ pri func decoder.skip_frame?(src: base.io_reader) {
|
|||||||
this.chunk_type_array[3] = 0
|
this.chunk_type_array[3] = 0
|
||||||
|
|
||||||
while true {
|
while true {
|
||||||
while args.src.length() < 8,
|
if args.src.length() < 8 {
|
||||||
post args.src.length() >= 8,
|
|
||||||
{
|
|
||||||
if args.src.is_closed() {
|
|
||||||
return "#bad chunk"
|
|
||||||
}
|
|
||||||
yield? base."$short read"
|
yield? base."$short read"
|
||||||
} endwhile
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
this.chunk_length = args.src.peek_u32be()
|
this.chunk_length = args.src.peek_u32be()
|
||||||
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
||||||
@@ -1141,14 +1133,10 @@ pri func decoder.do_decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reade
|
|||||||
}
|
}
|
||||||
|
|
||||||
while true {
|
while true {
|
||||||
while args.src.length() < 8,
|
if args.src.length() < 8 {
|
||||||
post args.src.length() >= 8,
|
|
||||||
{
|
|
||||||
if args.src.is_closed() {
|
|
||||||
return "#bad chunk"
|
|
||||||
}
|
|
||||||
yield? base."$short read"
|
yield? base."$short read"
|
||||||
} endwhile
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
this.chunk_length = args.src.peek_u32be()
|
this.chunk_length = args.src.peek_u32be()
|
||||||
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
this.chunk_type = (args.src.peek_u64le() >> 32) as base.u32
|
||||||
@@ -1234,9 +1222,8 @@ pri func decoder.do_decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reade
|
|||||||
break
|
break
|
||||||
} else if status.is_error() or
|
} else if status.is_error() or
|
||||||
((status == base."$short read") and args.src.is_closed()) {
|
((status == base."$short read") and args.src.is_closed()) {
|
||||||
// The input was truncated or invalid. Produce whatever
|
// The input was invalid or truncated. Produce whatever
|
||||||
// pixels we can and then, if truncated, generate "$short
|
// pixels we can.
|
||||||
// read" forever.
|
|
||||||
if this.workbuf_wi <= args.workbuf.length() {
|
if this.workbuf_wi <= args.workbuf.length() {
|
||||||
// This might return "#internal error: inconsistent
|
// This might return "#internal error: inconsistent
|
||||||
// workbuf length" because of the ".. this.workbuf_wi".
|
// workbuf length" because of the ".. this.workbuf_wi".
|
||||||
@@ -1244,9 +1231,7 @@ pri func decoder.do_decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reade
|
|||||||
this.filter_and_swizzle!(dst: args.dst, workbuf: args.workbuf[.. this.workbuf_wi])
|
this.filter_and_swizzle!(dst: args.dst, workbuf: args.workbuf[.. this.workbuf_wi])
|
||||||
}
|
}
|
||||||
if status == base."$short read" {
|
if status == base."$short read" {
|
||||||
while true {
|
return "#truncated input"
|
||||||
yield? base."$short read"
|
|
||||||
} endwhile
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yield? status
|
yield? status
|
||||||
|
|||||||
Reference in new issue
Block a user