summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-07-06 08:03:00 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2017-07-06 08:03:00 (GMT)
commit17668dc96167be8ebcd817aeb00dc13449470ac0 (patch)
treeb54d5d584514256f0146e303885e0df267fd9380
parent8ecadd7637f7da73ae44b691a1727208fecc145b (diff)
downloadlibmedia-thumbnail-17668dc96167be8ebcd817aeb00dc13449470ac0.zip
libmedia-thumbnail-17668dc96167be8ebcd817aeb00dc13449470ac0.tar.gz
libmedia-thumbnail-17668dc96167be8ebcd817aeb00dc13449470ac0.tar.bz2
Block memcpy when fail to create thumbnailrefs/changes/24/137524/1
Change-Id: Ia4c320f5e4c84f4c7b43ae806c62c323ff744b63 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xserver/thumb-server-internal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 58e9df3..10b7162 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -561,15 +561,18 @@ _media_thumb_process_raw(thumbMsg *req_msg, thumbMsg *res_msg)
thumb_w = req_msg->thumb_width;
thumb_h = req_msg->thumb_height;
res_msg->status = MS_MEDIA_ERR_NONE;
+ res_msg->msg_type = THUMB_RESPONSE_RAW_DATA;
err = _thumbnail_get_raw_data(origin_path, &thumb_w, &thumb_h, &data, &thumb_size);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("_thumbnail_get_data failed - %d", err);
res_msg->status = err;
+ res_msg->thumb_size = 0;
SAFE_FREE(data);
+
+ return err;
}
- res_msg->msg_type = THUMB_RESPONSE_RAW_DATA;
res_msg->thumb_width = thumb_w;
res_msg->thumb_height = thumb_h;
res_msg->thumb_size = thumb_size;