diff options
author | SeokHoon Lee <andy.shlee@samsung.com> | 2016-03-08 11:28:06 +0900 |
---|---|---|
committer | SeokHoon Lee <andy.shlee@samsung.com> | 2016-03-08 12:02:36 +0900 |
commit | 45448b9172666785396f8bd935bd37bd34fb8e7d (patch) | |
tree | 0fb8a6142ff0b68e3b6e0d32e61cfe76a9fdc400 | |
parent | 91df4c68c5c499da10e0be9af82a2ca2745bca68 (diff) | |
download | mediavision-45448b9172666785396f8bd935bd37bd34fb8e7d.tar.gz mediavision-45448b9172666785396f8bd935bd37bd34fb8e7d.tar.bz2 mediavision-45448b9172666785396f8bd935bd37bd34fb8e7d.zip |
readdir change to readdir_r.submit/tizen/20160311.064406accepted/tizen/wearable/20160311.145640accepted/tizen/tv/20160311.144836accepted/tizen/mobile/20160311.143259accepted/tizen/ivi/20160311.150307accepted/tizen/common/20160311.203725
Insert check code for avpicture_get_size error case.
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: Ie0440cc1660db1a39ae63dd79c90770714e4388f
-rw-r--r-- | packaging/capi-media-vision.spec | 2 | ||||
-rw-r--r-- | test/testsuites/barcode/barcode_test_suite.c | 6 | ||||
-rw-r--r-- | test/testsuites/face/face_test_suite.c | 14 |
3 files changed, 15 insertions, 7 deletions
diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec index 55aae326..79392162 100644 --- a/packaging/capi-media-vision.spec +++ b/packaging/capi-media-vision.spec @@ -1,6 +1,6 @@ Name: capi-media-vision Summary: Media Vision library for Tizen Native API -Version: 0.3.7 +Version: 0.3.8 Release: 0 Group: Multimedia/Framework License: Apache-2.0 and BSD-2.0 diff --git a/test/testsuites/barcode/barcode_test_suite.c b/test/testsuites/barcode/barcode_test_suite.c index 1c69eac5..c7bcaeca 100644 --- a/test/testsuites/barcode/barcode_test_suite.c +++ b/test/testsuites/barcode/barcode_test_suite.c @@ -120,6 +120,12 @@ int convert_rgb_to(unsigned char *src_buffer, unsigned char **dst_buffer, *cvt_buffer_size = avpicture_get_size(pixel_format, image_data.image_width, image_data.image_height); + if(*cvt_buffer_size < 0) { + avpicture_free(&dst_picture); + MEDIA_VISION_FUNCTION_LEAVE(); + return MEDIA_VISION_ERROR_OUT_OF_MEMORY; + } + (*dst_buffer) = (unsigned char*)malloc(*cvt_buffer_size); memcpy(*dst_buffer, dst_picture.data[0], *cvt_buffer_size); diff --git a/test/testsuites/face/face_test_suite.c b/test/testsuites/face/face_test_suite.c index eb6665fd..aceb9d00 100644 --- a/test/testsuites/face/face_test_suite.c +++ b/test/testsuites/face/face_test_suite.c @@ -532,14 +532,15 @@ int perform_mv_face_recognition_model_add_face_example( } DIR *dir; - struct dirent *ent; + struct dirent ent; + struct dirent *dent; if ((dir = opendir(in_file_name)) != NULL) { char file_path[1024] = ""; /* Traverses all the files and directories within source directory */ - while ((ent = readdir(dir)) != NULL) { + while (!readdir_r(dir, &ent, &dent) && dent) { /* Determine current entry name */ - const char *file_name = ent->d_name; + const char *file_name = ent.d_name; /* If current entry is directory, or hidden object, skip the step: */ if (file_name[0] == '.') @@ -904,15 +905,16 @@ int perform_model_evaluation(mv_face_recognition_model_h model) for (i = 0; i < dir_n; ++i) { DIR *dir; - struct dirent *ent; + struct dirent ent; + struct dirent *dent; printf("Processing %s...\n", directories[i]); if ((dir = opendir(directories[i])) != NULL) { char file_path[1024] = ""; /* Traverses all the files and directories within source directory */ - while ((ent = readdir(dir)) != NULL) { + while (!readdir_r(dir, &ent, &dent) && dent) { /* Determine current entry name */ - const char *file_name = ent->d_name; + const char *file_name = ent.d_name; /* If current entry is directory, or hidden object, skip the step: */ if (file_name[0] == '.') |