fix `{g,s}et-argb-pixels' bytes-length test
This commit is contained in:
parent
7069a267a6
commit
a736dcf6bf
|
@ -574,7 +574,7 @@
|
||||||
[exact-nonnegative-integer? h]
|
[exact-nonnegative-integer? h]
|
||||||
[bytes? bstr]
|
[bytes? bstr]
|
||||||
[any? [get-alpha? #f]])
|
[any? [get-alpha? #f]])
|
||||||
(unless ((bytes-length bstr) . > . (* w h))
|
(unless ((bytes-length bstr) . >= . (* w h 4))
|
||||||
(raise-mismatch-error (method-name 'bitmap% 'get-argb-pixels)
|
(raise-mismatch-error (method-name 'bitmap% 'get-argb-pixels)
|
||||||
"byte string is too short: "
|
"byte string is too short: "
|
||||||
bstr))
|
bstr))
|
||||||
|
@ -653,7 +653,7 @@
|
||||||
[exact-nonnegative-integer? h]
|
[exact-nonnegative-integer? h]
|
||||||
[bytes? bstr]
|
[bytes? bstr]
|
||||||
[any? [set-alpha? #f]])
|
[any? [set-alpha? #f]])
|
||||||
(unless ((bytes-length bstr) . > . (* w h))
|
(unless ((bytes-length bstr) . >= . (* w h 4))
|
||||||
(raise-mismatch-error (method-name 'bitmap% 'set-argb-pixels)
|
(raise-mismatch-error (method-name 'bitmap% 'set-argb-pixels)
|
||||||
"byte string is too short: "
|
"byte string is too short: "
|
||||||
bstr))
|
bstr))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user