]> gitweb.factorcode.org Git - factor.git/commitdiff
images.jpeg: fix loading error
authorJoe Groff <arcata@gmail.com>
Fri, 9 Jul 2010 21:30:26 +0000 (14:30 -0700)
committerJoe Groff <arcata@gmail.com>
Fri, 9 Jul 2010 21:30:26 +0000 (14:30 -0700)
basis/images/jpeg/jpeg.factor

index fa6d5688bce721b8281eeab058fd924f805f64bb..1050f0615d68d080e2d64e63df131dc085af7caf 100644 (file)
@@ -120,10 +120,8 @@ TUPLE: jpeg-color-info
     ] with-byte-reader ;
 
 : decode-huff-table ( chunk -- )
-    data>> [ binary <byte-reader> ] [ length ] bi
-    limit-stream <throws-on-eof>
-    [   
-        [ input-stream get [ count>> ] [ limit>> ] bi < ]
+    data>> [ binary <byte-reader> ] [ length ] bi limit-stream [
+        [ input-stream get stream>> [ count>> ] [ limit>> ] bi < ]
         [
             read4/4 swap 2 * +
             16 read
@@ -131,7 +129,7 @@ TUPLE: jpeg-color-info
             binary [ [ read [ B{ } ] unless* ] { } map-as ] with-byte-reader
             swap jpeg> huff-tables>> set-nth
         ] while
-    ] with-input-stream* ;
+    ] throws-on-eof ;
 
 : decode-scan ( chunk -- )
     data>>