fix `{g,s}et-argb-pixels' bytes-length test

This commit is contained in:
Matthew Flatt 2010-12-30 07:40:42 -07:00
parent 7069a267a6
commit a736dcf6bf

View File

@ -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))