Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ static esp_err_t usb_uac_device_input_cb(uint8_t *buf, size_t len, size_t *bytes
return ESP_FAIL;
}

/* Report full-length data for UAC */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: bytes_read not set on error path

When esp_codec_dev_read fails, the function returns early without setting *bytes_read. This leaves the output parameter uninitialized or containing stale data, potentially causing the caller to misinterpret how many bytes were actually read. The error path needs to set *bytes_read = 0 before returning to indicate no data was successfully read.

Fix in Cursor Fix in Web

if (bytes_read) {
*bytes_read = len;
}

return ESP_OK;
}

Expand Down