Skip to content

Commit

Permalink
Fix bug introduced in cupsRasterReadHeader* - was always returning 0.
Browse files Browse the repository at this point in the history
Add a raster error for I/O errors.

Migrate testraster to the test-internal.h framework.
  • Loading branch information
michaelrsweet committed Oct 21, 2024
1 parent 92a2a11 commit 3d1b3d4
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 244 deletions.
9 changes: 4 additions & 5 deletions cups/raster-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ _cupsRasterReadHeader(
DEBUG_printf("4_cupsRasterReadHeader: cupsHeight=%u", r->header.cupsHeight);
DEBUG_printf("4_cupsRasterReadHeader: r->bpp=%d", r->bpp);

return (0);
return (1);
}


Expand Down Expand Up @@ -1561,13 +1561,12 @@ cups_raster_io(cups_raster_t *r, // I - Raster stream

DEBUG_printf("6cups_raster_io: count=%d, total=%d", (int)count, (int)total);
if (count == 0)
{
break;
// {
// DEBUG_puts("6cups_raster_io: Returning 0.");
// return (0);
// }
}
else if (count < 0)
{
_cupsRasterAddError("I/O error");
DEBUG_puts("6cups_raster_io: Returning -1 on error.");
return (-1);
}
Expand Down
Loading

0 comments on commit 3d1b3d4

Please sign in to comment.