From: Kwanghoon Son Date: Tue, 5 Jul 2022 02:33:39 +0000 (-0400) Subject: [ITC][media-vision][Non-ACR] Fix heap overflow X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F277306%2F2;p=test%2Ftct%2Fnative%2Fapi.git [ITC][media-vision][Non-ACR] Fix heap overflow buffer size 1024 which is smaller than 20*30*3 Change-Id: I55452b61054f2184d2b1325c4371ce9a9f6151ad Reported-by: TSEVEN-2231 Signed-off-by: Kwanghoon Son --- diff --git a/src/itc/media-vision/ITs-media-vision-face.c b/src/itc/media-vision/ITs-media-vision-face.c index 6b52225cb..0932ee919 100755 --- a/src/itc/media-vision/ITs-media-vision-face.c +++ b/src/itc/media-vision/ITs-media-vision-face.c @@ -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); diff --git a/src/itc/media-vision/ITs-media-vision-image.c b/src/itc/media-vision/ITs-media-vision-image.c index a3c5ffdee..6fefa5022 100755 --- a/src/itc/media-vision/ITs-media-vision-image.c +++ b/src/itc/media-vision/ITs-media-vision-image.c @@ -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);