Skip to content

Commit

Permalink
Merge pull request #9653 from eric321/mp3-partial-frame-fix
Browse files Browse the repository at this point in the history
Fix infinite loop when there's a partial frame at the end of the file.
  • Loading branch information
jepler authored Sep 24, 2024
2 parents cda1947 + ca53f8b commit 726639b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared-module/audiomp3/MP3Decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
if (DO_DEBUG) {
mp_printf(&mp_plat_print, "%s:%d err=%d\n", __FILE__, __LINE__, err);
}
if (err != ERR_MP3_INDATA_UNDERFLOW && err != ERR_MP3_MAINDATA_UNDERFLOW) {
if (self->eof || (err != ERR_MP3_INDATA_UNDERFLOW && err != ERR_MP3_MAINDATA_UNDERFLOW)) {
memset(buffer, 0, self->frame_buffer_size);
*buffer_length = 0;
self->eof = true;
Expand Down

0 comments on commit 726639b

Please sign in to comment.