Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eaea47dc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "am-83fa0073-1c66-42ef-b933-72b932ba2be3" into cw-f-dev

* changes:
  [automerger] DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be written to am: 0362ba33 am: cfcaf486 am: ec7a8cf6
  [automerger] DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be written to am: 0362ba33 am: cfcaf486
  [automerger] DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be written to am: 0362ba33
  DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be written to
parents 7a6399cc e1aff891
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -276,7 +276,6 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(


    case AVRC_PDU_GET_PLAYER_APP_ATTR_TEXT:
    case AVRC_PDU_GET_PLAYER_APP_ATTR_TEXT:
    {
    {
        tAVRC_APP_SETTING_TEXT   *p_setting_text;
        UINT8                    num_attrs;
        UINT8                    num_attrs;


        if (len == 0)
        if (len == 0)
@@ -285,9 +284,13 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(
            break;
            break;
        }
        }
        BE_STREAM_TO_UINT8(num_attrs, p);
        BE_STREAM_TO_UINT8(num_attrs, p);
        if (num_attrs > AVRC_MAX_APP_ATTR_SIZE) {
          num_attrs = AVRC_MAX_APP_ATTR_SIZE;
        }
        AVRC_TRACE_DEBUG("%s attr count = %d ", __func__, p_result->get_app_attr_txt.num_attr);
        AVRC_TRACE_DEBUG("%s attr count = %d ", __func__, p_result->get_app_attr_txt.num_attr);
        p_result->get_app_attr_txt.num_attr = num_attrs;
        p_result->get_app_attr_txt.num_attr = num_attrs;
        p_setting_text = (tAVRC_APP_SETTING_TEXT*)osi_malloc(num_attrs * sizeof(tAVRC_APP_SETTING_TEXT));
        p_result->get_app_attr_txt.p_attrs = (tAVRC_APP_SETTING_TEXT*)
            osi_malloc(num_attrs * sizeof(tAVRC_APP_SETTING_TEXT));
        for (int xx = 0; xx < num_attrs; xx++)
        for (int xx = 0; xx < num_attrs; xx++)
        {
        {
            BE_STREAM_TO_UINT8(p_result->get_app_attr_txt.p_attrs[xx].attr_id, p);
            BE_STREAM_TO_UINT8(p_result->get_app_attr_txt.p_attrs[xx].attr_id, p);
@@ -307,7 +310,6 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(


    case AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT:
    case AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT:
    {
    {
        tAVRC_APP_SETTING_TEXT   *p_setting_text;
        UINT8                    num_vals;
        UINT8                    num_vals;


        if (len == 0)
        if (len == 0)
@@ -316,10 +318,14 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(
            break;
            break;
        }
        }
        BE_STREAM_TO_UINT8(num_vals, p);
        BE_STREAM_TO_UINT8(num_vals, p);
        if (num_vals > AVRC_MAX_APP_ATTR_SIZE) {
          num_vals = AVRC_MAX_APP_ATTR_SIZE;
        }
        p_result->get_app_val_txt.num_attr = num_vals;
        p_result->get_app_val_txt.num_attr = num_vals;
        AVRC_TRACE_DEBUG("%s value count = %d ", __func__, p_result->get_app_val_txt.num_attr);
        AVRC_TRACE_DEBUG("%s value count = %d ", __func__, p_result->get_app_val_txt.num_attr);


        p_setting_text = (tAVRC_APP_SETTING_TEXT *)osi_malloc(num_vals * sizeof(tAVRC_APP_SETTING_TEXT));
        p_result->get_app_val_txt.p_attrs = (tAVRC_APP_SETTING_TEXT *)
            osi_malloc(num_vals * sizeof(tAVRC_APP_SETTING_TEXT));
        for (int i = 0; i < num_vals; i++) {
        for (int i = 0; i < num_vals; i++) {
            BE_STREAM_TO_UINT8(p_result->get_app_val_txt.p_attrs[i].attr_id, p);
            BE_STREAM_TO_UINT8(p_result->get_app_val_txt.p_attrs[i].attr_id, p);
            BE_STREAM_TO_UINT16(p_result->get_app_val_txt.p_attrs[i].charset_id, p);
            BE_STREAM_TO_UINT16(p_result->get_app_val_txt.p_attrs[i].charset_id, p);