Don't erroneously set EOF flag if there was room to read 0 bytes

This commit is contained in:
Jeff Epler 2022-04-22 13:59:42 -05:00
parent 6425e937b5
commit 1841af90e2
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -53,7 +53,7 @@
*/ */
STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t *self) { STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t *self) {
// If we didn't previously reach the end of file, we can try reading now // If we didn't previously reach the end of file, we can try reading now
if (!self->eof) { if (!self->eof && self->inbuf_offset != 0) {
// Move the unconsumed portion of the buffer to the start // Move the unconsumed portion of the buffer to the start
uint8_t *end_of_buffer = self->inbuf + self->inbuf_length; uint8_t *end_of_buffer = self->inbuf + self->inbuf_length;