summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-07-14 04:49:33 (GMT)
committerhj kim <backto.kim@samsung.com>2017-07-19 01:12:51 (GMT)
commit32da7c25c64349bbc7fc330acb8922764e16e8c9 (patch)
tree9227a2b63fbdf584315d794eefc6d2ae81633a60
parent76f95b6f29447290a958ea8293e7ee90e7137108 (diff)
downloadlibmedia-thumbnail-32da7c25c64349bbc7fc330acb8922764e16e8c9.zip
libmedia-thumbnail-32da7c25c64349bbc7fc330acb8922764e16e8c9.tar.gz
libmedia-thumbnail-32da7c25c64349bbc7fc330acb8922764e16e8c9.tar.bz2
Change-Id: I3ca13cf412738708ff05864312b375ff58106fc4 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xserver/thumb-server-internal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 5974be3..1b8bac3 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -502,7 +502,12 @@ _media_thumb_process_raw(thumbMsg *req_msg, thumbMsg *res_msg)
res_msg->thumb_height = thumb_h;
res_msg->thumb_size = thumb_size;
res_msg->thumb_data = malloc(thumb_size * sizeof(unsigned char));
- memcpy(res_msg->thumb_data, data, thumb_size);
+ if (res_msg->thumb_data != NULL) {
+ memcpy(res_msg->thumb_data, data, thumb_size);
+ } else {
+ thumb_err("Allocation failed");
+ err = MS_MEDIA_ERR_OUT_OF_MEMORY;
+ }
SAFE_FREE(data);