Add to check decoding bmp failure and logs 95/187395/1
authorjiyong.min <jiyong.min@samsung.com>
Wed, 22 Aug 2018 23:31:45 +0000 (08:31 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Wed, 22 Aug 2018 23:33:26 +0000 (08:33 +0900)
Change-Id: Ia8fbb10ed8a5671b78b02f82b17a454ab01f8d82

bmp/mm_util_bmp.c
packaging/libmm-utility.spec
png/mm_util_png.c

index 940f3c1..c08dc12 100755 (executable)
@@ -153,7 +153,7 @@ static int _read_bmp(const char *filename, void *memory, size_t src_size, mm_uti
 
        code = bmp_decode(&bmp);
 
-       if (code != BMP_OK) {
+       if ((code != BMP_OK) || (bmp.bitmap == NULL)) {
                __print_error("bmp_decode", code);
                /* allow partially decoded images */
                if (code != BMP_INSUFFICIENT_DATA) {
index a5f9dc1..a745ade 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-utility
 Summary:    Multimedia Framework Utility Library
-Version:    0.1.26
+Version:    0.1.27
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index b21b331..7801502 100755 (executable)
@@ -57,7 +57,7 @@ static void __user_error_fn(png_structp png_ptr, png_const_charp error_msg)
 
 static void __user_warning_fn(png_structp png_ptr, png_const_charp warning_msg)
 {
-       mm_util_error("%s", warning_msg);
+       mm_util_warn("%s", warning_msg);
 }
 
 static void __read_data_fn(png_structp png_ptr, png_bytep data, png_size_t size)
@@ -198,6 +198,8 @@ static int _read_png(FILE *fp, void *memory, const size_t memory_size, mm_util_p
 
        png_read_image(png_ptr, row_pointers);
 
+       mm_util_sec_debug("Decoding with libpng is done!");
+
        decoded->data = (void *)png_malloc(png_ptr, sizeof(png_bytep) * data_size);
        if (decoded->data == NULL) {
                mm_util_error("out of memory");
@@ -212,6 +214,8 @@ static int _read_png(FILE *fp, void *memory, const size_t memory_size, mm_util_p
                png_free(png_ptr, row_pointers[row_index]);
        }
 
+       mm_util_sec_debug("The decoded data has been copied from png_ptr to out-buffer!");
+
        png_read_end(png_ptr, info_ptr);
        png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);