summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-12-02 19:53:31 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-12-02 19:54:25 +0000
commit6b04e5f2153b83a59df60c1aa8154fff7862d805 (patch)
tree614bdce4d0ceb57c7cd9de843e1269f606f90dd8 /src/lib/emile
parent00aaf99765a1021bcdb8aebc689cedabb089af6e (diff)
fix jpeg loading which freed the wrong ptr
fixes T8497 @fix
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 4f6e11905e..21317cbe15 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -1750,8 +1750,8 @@ _emile_jpeg_data(Emile_Image *image,
1750 uint8_t *ptr, *line[16], *data; 1750 uint8_t *ptr, *line[16], *data;
1751 volatile uint32_t *ptr2 = NULL; 1751 volatile uint32_t *ptr2 = NULL;
1752 uint32_t *ptr_rotate = NULL; 1752 uint32_t *ptr_rotate = NULL;
1753 uint16_t *ptrag = NULL, *ptrag_rotate = NULL; 1753 uint16_t *ptrag = NULL, *ptrag2 = NULL, *ptrag_rotate = NULL;
1754 uint8_t *ptrg = NULL, *ptrg_rotate = NULL; 1754 uint8_t *ptrg = NULL, *ptrg2 = NULL, *ptrg_rotate = NULL;
1755 unsigned int y, l, i, scans; 1755 unsigned int y, l, i, scans;
1756 volatile int region = 0; 1756 volatile int region = 0;
1757 /* rotation setting */ 1757 /* rotation setting */
@@ -2113,6 +2113,8 @@ _emile_jpeg_data(Emile_Image *image,
2113 /* We finally handle RGB with 1 component */ 2113 /* We finally handle RGB with 1 component */
2114 else if (cinfo.output_components == 1) 2114 else if (cinfo.output_components == 1)
2115 { 2115 {
2116 ptrg2 = ptrg;
2117 ptrag2 = ptrag;
2116 for (i = 0; (int)i < cinfo.rec_outbuf_height; i++) 2118 for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
2117 line[i] = data + (i * w); 2119 line[i] = data + (i * w);
2118 for (l = 0; l < h; l += cinfo.rec_outbuf_height) 2120 for (l = 0; l < h; l += cinfo.rec_outbuf_height)
@@ -2132,10 +2134,10 @@ _emile_jpeg_data(Emile_Image *image,
2132 switch (prop->cspace) 2134 switch (prop->cspace)
2133 { 2135 {
2134 case EMILE_COLORSPACE_GRY8: 2136 case EMILE_COLORSPACE_GRY8:
2135 _jpeg_gry8_convert_copy(&ptrg, &ptr, w); 2137 _jpeg_gry8_convert_copy(&ptrg2, &ptr, w);
2136 break; 2138 break;
2137 case EMILE_COLORSPACE_AGRY88: 2139 case EMILE_COLORSPACE_AGRY88:
2138 _jpeg_agry88_convert_copy(&ptrag, &ptr, w); 2140 _jpeg_agry88_convert_copy(&ptrag2, &ptr, w);
2139 break; 2141 break;
2140 default: 2142 default:
2141 _jpeg_argb8888_convert_copy(&ptr2, &ptr, w); 2143 _jpeg_argb8888_convert_copy(&ptr2, &ptr, w);
@@ -2168,10 +2170,10 @@ _emile_jpeg_data(Emile_Image *image,
2168 switch (prop->cspace) 2170 switch (prop->cspace)
2169 { 2171 {
2170 case EMILE_COLORSPACE_GRY8: 2172 case EMILE_COLORSPACE_GRY8:
2171 _jpeg_gry8_convert_copy(&ptrg, &ptr, opts_region.w); 2173 _jpeg_gry8_convert_copy(&ptrg2, &ptr, opts_region.w);
2172 break; 2174 break;
2173 case EMILE_COLORSPACE_AGRY88: 2175 case EMILE_COLORSPACE_AGRY88:
2174 _jpeg_agry88_convert_copy(&ptrag, &ptr, opts_region.w); 2176 _jpeg_agry88_convert_copy(&ptrag2, &ptr, opts_region.w);
2175 break; 2177 break;
2176 default: 2178 default:
2177 _jpeg_argb8888_convert_copy(&ptr2, &ptr, opts_region.w); 2179 _jpeg_argb8888_convert_copy(&ptr2, &ptr, opts_region.w);