From: hj kim Date: Wed, 24 Mar 2021 07:55:25 +0000 (+0900) Subject: webrtc : check invalid parameter at the beginning of webrtc_set_display() X-Git-Tag: submit/tizen/20210729.023123~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb44c46ae52e063733f13bd19bc12d9ab8ff6f33;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc : check invalid parameter at the beginning of webrtc_set_display() [Version] 0.1.133 [Issue Type] Improvement Change-Id: I1d744d05b270f15af7f4835d63e476d67d8d97d7 --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index ac3235ec..007f4119 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.1.132 +Version: 0.1.133 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index f5d93a13..d3c96f27 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -441,6 +441,7 @@ int webrtc_set_display(webrtc_h webrtc, unsigned int track_id, webrtc_display_ty RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(track_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "track id is 0"); + RET_VAL_IF(type > WEBRTC_DISPLAY_TYPE_EVAS, WEBRTC_ERROR_INVALID_PARAMETER, "invalid display type(%d)", type); RET_VAL_IF(display == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "display is NULL"); g_mutex_lock(&_webrtc->mutex); @@ -448,7 +449,6 @@ int webrtc_set_display(webrtc_h webrtc, unsigned int track_id, webrtc_display_ty RET_VAL_WITH_UNLOCK_IF(_webrtc->track_added_cb.callback == NULL, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "callback was not set"); RET_VAL_WITH_UNLOCK_IF(!_is_owner_of_track_build_context(_webrtc, track_id), WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "this function should be called within the track added callback"); - RET_VAL_IF(type > WEBRTC_DISPLAY_TYPE_EVAS, WEBRTC_ERROR_INVALID_PARAMETER, "invalid display type(%d)", type); ret = _set_display_to_sink(webrtc, track_id, (unsigned int)type, (void *)display); if (ret == WEBRTC_ERROR_NONE)