From: Jungsup Lee Date: Thu, 6 Sep 2018 11:31:52 +0000 (+0900) Subject: protocol-native: Use pa_atoi() instead of pa_atou() for parse buffer attributes X-Git-Tag: submit/tizen/20180912.070306^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F188756%2F2;p=platform%2Fupstream%2Fpulseaudio.git protocol-native: Use pa_atoi() instead of pa_atou() for parse buffer attributes Buffer attributes can be set to '-1' but pa_atou() return fail if input string begin with '-' sign Change-Id: Ic2923de238b56dc29299dec31fe19d0a64c9794c Signed-off-by: Jungsup Lee --- diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 1492edd..a8f7a26 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -3,7 +3,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 11.1 -Release: 46 +Release: 47 Group: Multimedia/Audio License: LGPL-2.1 URL: http://pulseaudio.org diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index d488ee9..071d21f 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -513,8 +513,8 @@ static int update_buffer_attr(pa_proplist* proplist, pa_buffer_attr* ret_attr, b pa_log_error("failed to get %s", PA_PROP_BUFFER_ATTR_MAXLENGTH); return -1; } - if (pa_atou(_propStr, &ret_attr->maxlength)) { - pa_log_error("failed to pa_atou for maxlength"); + if (pa_atoi(_propStr, (int32_t*)(&ret_attr->maxlength))) { + pa_log_error("failed to pa_atoi for maxlength"); return -1; } @@ -524,8 +524,8 @@ static int update_buffer_attr(pa_proplist* proplist, pa_buffer_attr* ret_attr, b pa_log_error("failed to get %s", PA_PROP_BUFFER_ATTR_TLENGTH); return -1; } - if (pa_atou(_propStr, &ret_attr->tlength)) { - pa_log_error("failed to pa_atou for tlength"); + if (pa_atoi(_propStr, (int32_t*)(&ret_attr->tlength))) { + pa_log_error("failed to pa_atoi for tlength"); return -1; } @@ -533,8 +533,8 @@ static int update_buffer_attr(pa_proplist* proplist, pa_buffer_attr* ret_attr, b pa_log_error("failed to get %s", PA_PROP_BUFFER_ATTR_PREBUF); return -1; } - if (pa_atou(_propStr, &ret_attr->prebuf)) { - pa_log_error("failed to pa_atou for prebuf"); + if (pa_atoi(_propStr, (int32_t*)(&ret_attr->prebuf))) { + pa_log_error("failed to pa_atoi for prebuf"); return -1; } @@ -542,8 +542,8 @@ static int update_buffer_attr(pa_proplist* proplist, pa_buffer_attr* ret_attr, b pa_log_error("failed to get %s", PA_PROP_BUFFER_ATTR_MINREQ); return -1; } - if (pa_atou(_propStr, &ret_attr->minreq)) { - pa_log_error("failed to pa_atou for minreq"); + if (pa_atoi(_propStr, (int32_t*)(&ret_attr->minreq))) { + pa_log_error("failed to pa_atoi for minreq"); return -1; } @@ -556,8 +556,8 @@ static int update_buffer_attr(pa_proplist* proplist, pa_buffer_attr* ret_attr, b pa_log_error("failed to get %s", PA_PROP_BUFFER_ATTR_FRAGSIZE); return -1; } - if (pa_atou(_propStr, &ret_attr->fragsize)) { - pa_log_error("failed to pa_atou for fragsize"); + if (pa_atoi(_propStr, (int32_t*)(&ret_attr->fragsize))) { + pa_log_error("failed to pa_atoi for fragsize"); return -1; }