librui : check invalid frame count 35/164735/2 accepted/tizen/unified/20171222.062605 submit/tizen-tizen/20171221.160741 submit/tizen/20171221.160821
authorKichan Kwon <k_c.kwon@samsung.com>
Wed, 18 Oct 2017 00:58:37 +0000 (09:58 +0900)
committerPaweł Szewczyk <p.szewczyk@samsung.com>
Thu, 21 Dec 2017 14:42:19 +0000 (15:42 +0100)
Change-Id: Ide15d8f11bfc4c2ada4f2bdaf33bfe479a7f58bd
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
src/librui/resources.c

index e55f93c..cd579f4 100644 (file)
@@ -294,7 +294,13 @@ int res_create_anim_image_surfaces(const char *name, int *frames,
                                break;
                        }
 
-       if (height % *frames) {
+       if (*frames <= 0) {
+               printf("Bad frame count (%d)\n", *frames);
+               result = -9;
+               goto exit;
+       }
+
+       if (height % *frames || height < *frames) {
                printf("Bad image height (%d) for frame count (%d)\n",
                                (int)height, *frames);
                result = -9;