From be8033a39f7e91afb923648e9155e922dd53b6e7 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 28 Sep 2009 16:29:56 -0500 Subject: [PATCH] limit the byte-reader streams when loading images --- basis/images/loader/loader.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basis/images/loader/loader.factor b/basis/images/loader/loader.factor index 8c458b0c9f..acb0f2ca86 100644 --- a/basis/images/loader/loader.factor +++ b/basis/images/loader/loader.factor @@ -3,7 +3,7 @@ USING: accessors assocs byte-arrays combinators images io.encodings.binary io.pathnames io.streams.byte-array io.streams.limited kernel namespaces splitting strings -unicode.case ; +unicode.case sequences ; IN: images.loader ERROR: unknown-image-extension extension ; @@ -33,7 +33,10 @@ GENERIC: stream>image ( stream class -- image ) [ open-image-file ] [ image-class ] bi load-image* ; M: byte-array load-image* - [ binary ] dip stream>image ; + [ + [ binary ] + [ length stream-throws ] bi + ] dip stream>image ; M: limited-stream load-image* stream>image ;