esp-adf
esp-adf copied to clipboard
tone_partition 中 tone_partition_get_file_info 判断有误 (AUD-6137)
esp_err_t tone_partition_get_file_info(tone_partition_handle_t handle, uint16_t index, tone_file_info_t *info)
{
AUDIO_NULL_CHECK(TAG, handle, return ESP_FAIL);
AUDIO_NULL_CHECK(TAG, info, return ESP_FAIL);
if (handle->header.total_num < index) {
ESP_LOGE(TAG, "Wanted index out of range index[%d]", index);
return ESP_FAIL;
}
........
问题:index 的值为 0 ~ total_num-1,如果 index = total_num,此判断逻辑就有问题。
esp-idf v5.3.2适用此更改