summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-29 15:30:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-29 17:58:34 +0900
commitcc5cccc511a3823bf328772e7b7ef9cfa852af54 (patch)
tree7915a73f3f1cbde7d5eef594b440bb7065385aba /src/lib/emile
parente586b9debc22ff3257d9405cf0ed0ebf8cf919b8 (diff)
Eet: fix decoding of embedded ETC images
Typos, lack of NULL check, excessive sizeof(type) not matching the object type, no border set, etc... This all lead to a crash and then no render (with an error message and then without...). This also simplifies the implicit loading of ETC1 as ETC2 when supported by the driver. @fix
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 58a37c5c45..c7d12b83a0 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -177,27 +177,28 @@ _roundup(int val, int rup)
177 177
178/* TGV Handling */ 178/* TGV Handling */
179 179
180static const Emile_Colorspace cspaces_etc1[2] = { 180static const Emile_Colorspace cspaces_etc1[] = {
181 EMILE_COLORSPACE_ETC1, 181 EMILE_COLORSPACE_ETC1,
182 EMILE_COLORSPACE_RGB8_ETC2,
182 EMILE_COLORSPACE_ARGB8888 183 EMILE_COLORSPACE_ARGB8888
183}; 184};
184 185
185static const Emile_Colorspace cspaces_rgb8_etc2[2] = { 186static const Emile_Colorspace cspaces_rgb8_etc2[] = {
186 EMILE_COLORSPACE_RGB8_ETC2, 187 EMILE_COLORSPACE_RGB8_ETC2,
187 EMILE_COLORSPACE_ARGB8888 188 EMILE_COLORSPACE_ARGB8888
188}; 189};
189 190
190static const Emile_Colorspace cspaces_rgba8_etc2_eac[2] = { 191static const Emile_Colorspace cspaces_rgba8_etc2_eac[] = {
191 EMILE_COLORSPACE_RGBA8_ETC2_EAC, 192 EMILE_COLORSPACE_RGBA8_ETC2_EAC,
192 EMILE_COLORSPACE_ARGB8888 193 EMILE_COLORSPACE_ARGB8888
193}; 194};
194 195
195static const Emile_Colorspace cspaces_etc1_alpha[2] = { 196static const Emile_Colorspace cspaces_etc1_alpha[] = {
196 EMILE_COLORSPACE_ETC1_ALPHA, 197 EMILE_COLORSPACE_ETC1_ALPHA,
197 EMILE_COLORSPACE_ARGB8888 198 EMILE_COLORSPACE_ARGB8888
198}; 199};
199 200
200static const Emile_Colorspace cspaces_agry[3] = { 201static const Emile_Colorspace cspaces_gry[] = {
201 EMILE_COLORSPACE_GRY8, 202 EMILE_COLORSPACE_GRY8,
202 EMILE_COLORSPACE_AGRY88, 203 EMILE_COLORSPACE_AGRY88,
203 EMILE_COLORSPACE_ARGB8888 204 EMILE_COLORSPACE_ARGB8888
@@ -1414,7 +1415,7 @@ _emile_jpeg_head(Emile_Image *image,
1414 if (cinfo.jpeg_color_space == JCS_GRAYSCALE) 1415 if (cinfo.jpeg_color_space == JCS_GRAYSCALE)
1415 { 1416 {
1416 /* We do handle GRY8 and AGRY88 (with FF for alpha) colorspace as an output for JPEG */ 1417 /* We do handle GRY8 and AGRY88 (with FF for alpha) colorspace as an output for JPEG */
1417 prop->cspaces = cspaces_agry; 1418 prop->cspaces = cspaces_gry;
1418 } 1419 }
1419 1420
1420 /* rotation decoding */ 1421 /* rotation decoding */