mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Fix std/png decode_frame workbuf bounds checks
This commit is contained in:
1 parent
3faddde52d
commit
d655f51dae
2 files changed
+3
-3
No files matched your search
@@ -30527,7 +30527,7 @@ wuffs_png__decoder__decode_frame(
|
|||||||
}
|
}
|
||||||
self->private_impl.f_workbuf_wi = 0;
|
self->private_impl.f_workbuf_wi = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if ((self->private_impl.f_workbuf_wi >= self->private_impl.f_workbuf_length) || (self->private_impl.f_workbuf_length >= ((uint64_t)(a_workbuf.len)))) {
|
if ((self->private_impl.f_workbuf_wi > self->private_impl.f_workbuf_length) || (self->private_impl.f_workbuf_length > ((uint64_t)(a_workbuf.len)))) {
|
||||||
status = wuffs_base__make_status(wuffs_base__error__bad_workbuf_length);
|
status = wuffs_base__make_status(wuffs_base__error__bad_workbuf_length);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
|
|||||||
|
|
||||||
this.workbuf_wi = 0
|
this.workbuf_wi = 0
|
||||||
while true {
|
while true {
|
||||||
if (this.workbuf_wi >= this.workbuf_length) or (
|
if (this.workbuf_wi > this.workbuf_length) or (
|
||||||
this.workbuf_length >= args.workbuf.length()) {
|
this.workbuf_length > args.workbuf.length()) {
|
||||||
return base."#bad workbuf length"
|
return base."#bad workbuf length"
|
||||||
}
|
}
|
||||||
io_bind (io: w, data: args.workbuf[this.workbuf_wi .. this.workbuf_length]) {
|
io_bind (io: w, data: args.workbuf[this.workbuf_wi .. this.workbuf_length]) {
|
||||||
|
|||||||
Reference in new issue
Block a user