diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-03 09:55:03 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-03 09:55:03 +0100 |
commit | 23c348d62ab9f0a902189c70921310a5f856852c (patch) | |
tree | 08c40dc8b180b31f504945e8da3e3ea3950e4145 /backend/escl/escl_jpeg.c | |
parent | 2938695ca4c9bca7834817465662e31570f6d32f (diff) | |
parent | 44916ca6d75e0b5f258a098a50d659f31c6625fd (diff) |
Update upstream source from tag 'upstream/1.3.0'
Update to upstream version '1.3.0'
with Debian dir ab14a3d39c8a7f8e08536efd939bb78110db77f3
Diffstat (limited to 'backend/escl/escl_jpeg.c')
-rw-r--r-- | backend/escl/escl_jpeg.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/backend/escl/escl_jpeg.c b/backend/escl/escl_jpeg.c index 1dd3ec9..62c20c0 100644 --- a/backend/escl/escl_jpeg.c +++ b/backend/escl/escl_jpeg.c @@ -232,7 +232,13 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps) y_off, w, h); - surface = malloc(w * h * cinfo.output_components); + jpeg_start_decompress(&cinfo); + if (x_off > 0 || w < cinfo.output_width) + jpeg_crop_scanline(&cinfo, &x_off, &w); + lineSize = w * cinfo.output_components; + if (y_off > 0) + jpeg_skip_scanlines(&cinfo, y_off); + surface = malloc(cinfo.output_width * cinfo.output_height * cinfo.output_components); if (surface == NULL) { jpeg_destroy_decompress(&cinfo); DBG( 1, "Escl Jpeg : Memory allocation problem\n"); @@ -242,12 +248,6 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps) } return (SANE_STATUS_NO_MEM); } - jpeg_start_decompress(&cinfo); - if (x_off > 0 || w < cinfo.output_width) - jpeg_crop_scanline(&cinfo, &x_off, &w); - lineSize = w * cinfo.output_components; - if (y_off > 0) - jpeg_skip_scanlines(&cinfo, y_off); pos = 0; while (cinfo.output_scanline < (unsigned int)rh) { rowptr[0] = (JSAMPROW)surface + (lineSize * pos); // ..cinfo.output_scanline); |