bare-exif 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.c CHANGED
@@ -109,6 +109,7 @@ bare_exif_init_data(js_env_t *env, js_callback_info_t *info) {
109
109
  }
110
110
 
111
111
  bare_exif_data_t *data = malloc(sizeof(bare_exif_data_t));
112
+ assert(data != NULL);
112
113
 
113
114
  data->handle = handle;
114
115
 
@@ -168,6 +169,7 @@ bare_exif_init_entry(js_env_t *env, js_callback_info_t *info) {
168
169
  if (handle == NULL) return NULL;
169
170
 
170
171
  bare_exif_entry_t *entry = malloc(sizeof(bare_exif_entry_t));
172
+ assert(entry != NULL);
171
173
 
172
174
  entry->handle = handle;
173
175
 
@@ -312,13 +314,17 @@ bare_exif_save_data(js_env_t *env, js_callback_info_t *info) {
312
314
  js_value_t *result;
313
315
  void *output;
314
316
  err = js_create_arraybuffer(env, len, &output, &result);
315
- assert(err == 0);
316
317
 
317
- if (len > 0) {
318
- memcpy(output, bytes, len);
318
+ if (err < 0) {
319
319
  free(bytes);
320
+
321
+ return NULL;
320
322
  }
321
323
 
324
+ if (len > 0) memcpy(output, bytes, len);
325
+
326
+ free(bytes);
327
+
322
328
  return result;
323
329
  }
324
330
 
@@ -71,15 +71,23 @@ if(CMAKE_C_COMPILER)
71
71
  cmake_path(GET CMAKE_C_COMPILER PARENT_PATH CC_path)
72
72
  cmake_path(GET CMAKE_C_COMPILER FILENAME CC_filename)
73
73
 
74
+ set(flags "--target=${CMAKE_C_COMPILER_TARGET}")
75
+
76
+ if(APPLE)
77
+ string(APPEND flags " -isysroot ${CMAKE_OSX_SYSROOT}")
78
+ elseif(ANDROID)
79
+ string(APPEND flags " --sysroot=${CMAKE_SYSROOT}")
80
+ endif()
81
+
74
82
  list(APPEND env
75
83
  "CC=${CC_filename}"
76
- "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET}"
84
+ "CFLAGS=${flags}"
77
85
  )
78
86
 
79
87
  if(CMAKE_LINKER_TYPE MATCHES "LLD")
80
- list(APPEND env "LDFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -fuse-ld=lld")
88
+ list(APPEND env "LDFLAGS=${flags} -fuse-ld=lld")
81
89
  else()
82
- list(APPEND env "LDFLAGS=--target=${CMAKE_C_COMPILER_TARGET}")
90
+ list(APPEND env "LDFLAGS=${flags}")
83
91
  endif()
84
92
 
85
93
  list(APPEND path "${CC_path}")
@@ -122,7 +130,7 @@ list(JOIN path ":" path)
122
130
  list(APPEND env "PATH=${path}")
123
131
 
124
132
  declare_port(
125
- "github:libexif/libexif@0.6.25"
133
+ "github:libexif/libexif@0.6.26"
126
134
  exif
127
135
  AUTOTOOLS
128
136
  BYPRODUCTS lib/${lib}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-exif",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "EXIF support for Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
Binary file
Binary file
Binary file
Binary file