Change-Id: I51308a8a1fc980a778cbb5a486548cde17521e7f
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
decoded->height = bmp.height;
decoded->size = bmp.width * bmp.height * BYTES_PER_PIXEL;
decoded->data = malloc(decoded->size);
+ if (decoded->data == NULL) {
+ mm_util_error("Failed to saved memory allocation");
+ res = MM_UTIL_ERROR_OUT_OF_MEMORY;
+ goto cleanup;
+ }
memcpy(decoded->data, bmp.bitmap, decoded->size);
cleanup:
if (size > 0) {
*(write_data_ptr->mem) = (void *)realloc(*(write_data_ptr->mem), (write_data_ptr->size + size));
- memcpy(*(write_data_ptr->mem) + write_data_ptr->size, data, size);
- write_data_ptr->size += size;
+ if (*(write_data_ptr->mem) != NULL) {
+ memcpy(*(write_data_ptr->mem) + write_data_ptr->size, data, size);
+ write_data_ptr->size += size;
+ }
}
return size;
}
Name: libmm-utility
Summary: Multimedia Framework Utility Library
-Version: 0.31
+Version: 0.32
Release: 0
Group: System/Libraries
License: Apache-2.0