Check size before allocation 16/231416/1 accepted/tizen/unified/20200422.215425 submit/tizen/20200422.001719
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 22 Apr 2020 01:51:00 +0000 (10:51 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 22 Apr 2020 01:51:00 +0000 (10:51 +0900)
Change-Id: Ie50555a55b2d8abc35321ccafd344b7416ac595f
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-svc-util.c

index ee90b15..02fc585 100644 (file)
@@ -848,7 +848,8 @@ static int __image_360_check(const char *path)
                                goto ERROR;
 
                        exif_app1_xmp_size = (long)((exif_app1_xmp_t[0] << 8) | (exif_app1_xmp_t[1])) - 2;
-
+                       if (exif_app1_xmp_size == 0)
+                               goto ERROR;
 
                        xmp_data = g_malloc(exif_app1_xmp_size);
                        ptr = xmp_data;