[ITC][media-vision][Non-ACR] Fix heap overflow 06/277306/2
authorKwanghoon Son <k.son@samsung.com>
Tue, 5 Jul 2022 02:33:39 +0000 (22:33 -0400)
committerKwanghoon Son <k.son@samsung.com>
Tue, 5 Jul 2022 04:30:19 +0000 (00:30 -0400)
buffer size 1024 which is smaller than 20*30*3

Change-Id: I55452b61054f2184d2b1325c4371ce9a9f6151ad
Reported-by: TSEVEN-2231
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
src/itc/media-vision/ITs-media-vision-face.c
src/itc/media-vision/ITs-media-vision-image.c

index 6b52225cb9aa9777715ff99e57bf163d8dbb8d58..0932ee919d56b3d35f2873e9e1ca8b53859997b6 100755 (executable)
@@ -385,7 +385,7 @@ int ITc_mv_face_detect_p(void)
     g_pBufferData = calloc(1, BUFFERSIZE);
     CHECK_HANDLE(g_pBufferData, "calloc");
 
-    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 30, MEDIA_VISION_COLORSPACE_RGB888);
+    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 10, MEDIA_VISION_COLORSPACE_RGB888);
     PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet), FREE_MEMORY(g_pBufferData));
 
     nRet = mv_face_detect(g_hMvSource, NULL, MvFaceDetectedCB, &number_of_faces_on_image);
@@ -434,7 +434,7 @@ int ITc_mv_face_recognition_model_save_load_p(void)
     g_pBufferData = calloc(1, BUFFERSIZE);
     CHECK_HANDLE(g_pBufferData, "calloc");
 
-    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 30, MEDIA_VISION_COLORSPACE_RGB888);
+    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 10, MEDIA_VISION_COLORSPACE_RGB888);
     PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet), FREE_MEMORY(g_pBufferData));
 
     nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
@@ -620,7 +620,7 @@ int ITc_mv_face_recognition_model_learn_p(void)
     g_pBufferData = calloc(1, BUFFERSIZE);
     CHECK_HANDLE(g_pBufferData, "calloc");
 
-    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 30, MEDIA_VISION_COLORSPACE_RGB888);
+    nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 10, MEDIA_VISION_COLORSPACE_RGB888);
     PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet), FREE_MEMORY(g_pBufferData));
 
     nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
index a3c5ffdeedf28ec4cb0d97912555ac68d59c2511..6fefa5022b810a5f296887c472fb36038cc13d65 100755 (executable)
@@ -158,7 +158,7 @@ int ITc_mv_image_object_fill_p(void)
     g_pBufferData = calloc(1, BUFFERSIZE);
     CHECK_HANDLE(g_pBufferData, "calloc");
 
-    nRet = mv_source_fill_by_buffer(hTargetImage, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 30, MEDIA_VISION_COLORSPACE_RGB888);
+    nRet = mv_source_fill_by_buffer(hTargetImage, (unsigned char *)g_pBufferData, BUFFERSIZE, 20, 10, MEDIA_VISION_COLORSPACE_RGB888);
     PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet), FREE_MEMORY(g_pBufferData));
 
     nRet = mv_image_object_create(&htarget);