mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
std/jpeg: fix default-quality workbuf length check
This commit is contained in:
1 parent
affff51fbf
commit
53b3b0a9d0
2 files changed
+4
-4
No files matched your search
@@ -993,10 +993,10 @@ pri func decoder.do_decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reade
|
||||
// is long enough and setting this.swizzle_immediately.
|
||||
this.swizzle_immediately = false
|
||||
if this.components_workbuf_offsets[8] > args.workbuf.length() {
|
||||
if this.sof_marker >= 0xC2 {
|
||||
if (this.sof_marker >= 0xC2) or not this.use_lower_quality {
|
||||
return base."#bad workbuf length"
|
||||
}
|
||||
this.swizzle_immediately = this.use_lower_quality
|
||||
this.swizzle_immediately = true
|
||||
this.swizzle_immediately_status = ok
|
||||
} else if this.components_workbuf_offsets[4] < this.components_workbuf_offsets[8] {
|
||||
args.workbuf[this.components_workbuf_offsets[4] .. this.components_workbuf_offsets[8]].bulk_memset!(byte_value: 0)
|
||||
|
||||
Reference in new issue
Block a user