Permalink
Browse files

fix XBin reading to stop when the height indicated in the header is r…

…eached
  • Loading branch information...
1 parent 1c24b8b commit a0fa8da7effb389c1d1dc37982b91b32d2c76359 @bricas committed Feb 27, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −0 Changes
  2. +2 −2 lib/Image/TextMode/Reader/XBin.pm
View
@@ -2,6 +2,7 @@ Revision history for Perl extension Image::TextMode.
0.17 TO BE RELEASED
- fix IDF reading when a SAUCE record is found
+ - fix XBin reading to stop when the height indicated in the header is reached
0.16 2012-02-15
- dos_aspect, a DOS aspect ratio emulation mode option, has been added to
@@ -121,7 +121,7 @@ sub _parse_compressed {
my $height = $image->header->{ height };
my $info;
- while ( read( $fh, $info, 1 ) ) {
+ READ: while ( read( $fh, $info, 1 ) ) {
$info = unpack( 'C', $info );
last if $info == 26;
@@ -159,7 +159,7 @@ sub _parse_compressed {
if ( $x == $width ) {
$x = 0;
$y++;
- last if $y == $height;
+ last READ if $y == $height;
}
}
}

0 comments on commit a0fa8da

Please sign in to comment.