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

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

Merge "AVRCP: Initialize buffer for attribute values to be written to" into oc-dev

parents e5ffb94d c86198a6
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -502,7 +502,6 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(tAVRC_MSG_VENDOR* p_msg,
    } break;

    case AVRC_PDU_GET_PLAYER_APP_ATTR_TEXT: {
      tAVRC_APP_SETTING_TEXT* p_setting_text;
      uint8_t num_attrs;

      if (len == 0) {
@@ -510,10 +509,14 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(tAVRC_MSG_VENDOR* p_msg,
        break;
      }
      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);
      p_result->get_app_attr_txt.num_attr = num_attrs;
      p_setting_text = (tAVRC_APP_SETTING_TEXT*)osi_malloc(

      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++) {
        BE_STREAM_TO_UINT8(p_result->get_app_attr_txt.p_attrs[xx].attr_id, p);
@@ -533,7 +536,6 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(tAVRC_MSG_VENDOR* p_msg,
    } break;

    case AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT: {
      tAVRC_APP_SETTING_TEXT* p_setting_text;
      uint8_t num_vals;

      if (len == 0) {
@@ -541,11 +543,14 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(tAVRC_MSG_VENDOR* p_msg,
        break;
      }
      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;
      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(
      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++) {
        BE_STREAM_TO_UINT8(p_result->get_app_val_txt.p_attrs[i].attr_id, p);