summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-12-18 11:16:38 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-12-18 11:28:10 +0000
commit00f5eed1d2390d204c83a2cb78a37531f6bbe49c (patch)
treeb3c95338bd7d90127e904ac972859779a15b0e64
parent5f3152a30b6d53def24b85a1b76c75c82edc3c08 (diff)
evas - avif - fix for 0.8.2 libavif that broke api
also require 0.8.2 ... as well - no point trying to support older versions forever and this is still experimental. fixes T8844 @fix
-rw-r--r--src/lib/evas/meson.build2
-rw-r--r--src/modules/evas/image_loaders/avif/evas_image_load_avif.c14
2 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/evas/meson.build b/src/lib/evas/meson.build
index 883a959aa2..8dcfd98713 100644
--- a/src/lib/evas/meson.build
+++ b/src/lib/evas/meson.build
@@ -10,7 +10,7 @@ giflib = cc.find_library('gif')
10webp = dependency('libwebp', version: ['>=0.5.0'], required: get_option('evas-loaders-disabler').contains('webp') == false) 10webp = dependency('libwebp', version: ['>=0.5.0'], required: get_option('evas-loaders-disabler').contains('webp') == false)
11webpdemux = dependency('libwebpdemux', version: ['>=0.5.0'], required: get_option('evas-loaders-disabler').contains('webp') == false) 11webpdemux = dependency('libwebpdemux', version: ['>=0.5.0'], required: get_option('evas-loaders-disabler').contains('webp') == false)
12libopenjp2 = dependency('libopenjp2', required: get_option('evas-loaders-disabler').contains('jp2k') == false) 12libopenjp2 = dependency('libopenjp2', required: get_option('evas-loaders-disabler').contains('jp2k') == false)
13libavif = dependency('libavif', required: get_option('evas-loaders-disabler').contains('avif') == false) 13libavif = dependency('libavif', required: get_option('evas-loaders-disabler').contains('avif') == false, version: '>= 0.8.2')
14 14
15evas_image_loaders_file = [ 15evas_image_loaders_file = [
16 ['avif', 'shared', [libavif]], 16 ['avif', 'shared', [libavif]],
diff --git a/src/modules/evas/image_loaders/avif/evas_image_load_avif.c b/src/modules/evas/image_loaders/avif/evas_image_load_avif.c
index 34b6da9bd3..f7cfe0ef03 100644
--- a/src/modules/evas/image_loaders/avif/evas_image_load_avif.c
+++ b/src/modules/evas/image_loaders/avif/evas_image_load_avif.c
@@ -43,7 +43,6 @@ evas_image_load_file_head_avif_internal(Evas_Loader_Internal *loader,
43 int *error) 43 int *error)
44{ 44{
45 Evas_Image_Animated *animated; 45 Evas_Image_Animated *animated;
46 avifROData raw;
47 avifDecoder *decoder; 46 avifDecoder *decoder;
48 avifResult res; 47 avifResult res;
49 Eina_Bool ret; 48 Eina_Bool ret;
@@ -55,9 +54,6 @@ evas_image_load_file_head_avif_internal(Evas_Loader_Internal *loader,
55 prop->h = 0; 54 prop->h = 0;
56 prop->alpha = EINA_FALSE; 55 prop->alpha = EINA_FALSE;
57 56
58 raw.size = length;
59 raw.data = (const uint8_t *)map;
60
61 decoder = avifDecoderCreate(); 57 decoder = avifDecoderCreate();
62 if (!decoder) 58 if (!decoder)
63 { 59 {
@@ -65,7 +61,8 @@ evas_image_load_file_head_avif_internal(Evas_Loader_Internal *loader,
65 return ret; 61 return ret;
66 } 62 }
67 63
68 res = avifDecoderParse(decoder, &raw); 64 avifDecoderSetIOMemory(decoder, (const uint8_t *)map, length);
65 res = avifDecoderParse(decoder);
69 if (res != AVIF_RESULT_OK) 66 if (res != AVIF_RESULT_OK)
70 { 67 {
71 ERR("avif file format invalid"); 68 ERR("avif file format invalid");
@@ -141,7 +138,6 @@ evas_image_load_file_data_avif_internal(Evas_Loader_Internal *loader,
141 decoder = loader->decoder; 138 decoder = loader->decoder;
142 if (!decoder) 139 if (!decoder)
143 { 140 {
144 avifROData raw;
145 decoder = avifDecoderCreate(); 141 decoder = avifDecoderCreate();
146 if (!decoder) 142 if (!decoder)
147 { 143 {
@@ -149,10 +145,8 @@ evas_image_load_file_data_avif_internal(Evas_Loader_Internal *loader,
149 return EINA_FALSE; 145 return EINA_FALSE;
150 } 146 }
151 147
152 raw.size = length; 148 avifDecoderSetIOMemory(decoder, (const uint8_t *)map, length);
153 raw.data = (const uint8_t *)map; 149 res = avifDecoderParse(decoder);
154
155 res = avifDecoderParse(decoder, &raw);
156 if (res != AVIF_RESULT_OK) 150 if (res != AVIF_RESULT_OK)
157 { 151 {
158 *error = EVAS_LOAD_ERROR_GENERIC; 152 *error = EVAS_LOAD_ERROR_GENERIC;