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

Commit e1aff891 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be...

[automerger] DO NOT MERGE: AVRCP: Initialize buffer for attribute values to be written to am: 0362ba33 am: cfcaf486 am: ec7a8cf6

Change-Id: Id16ba673c11bb21522f8f240cc77211e33681ca1
parents ff8ddbfe ec7a8cf6
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -269,7 +269,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)
@@ -278,9 +277,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);
@@ -300,7 +303,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)
@@ -309,10 +311,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);