10000 Fix infinite loop when there's a partial frame at the end of the file. · eric321/circuitpython@ca53f8b · GitHub
[go: up one dir, main page]

Skip to content

Commit ca53f8b

Browse files
committed
Fix infinite loop when there's a partial frame at the end of the file.
1 parent cda1947 commit ca53f8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/audiomp3/MP3Decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
482482
if (DO_DEBUG) {
483483
mp_printf(&mp_plat_print, "%s:%d err=%d\n", __FILE__, __LINE__, err);
484484
}
485-
if (err != ERR_MP3_INDATA_UNDERFLOW && err != ERR_MP3_MAINDATA_UNDERFLOW) {
485+
if (self->eof || (err != ERR_MP3_INDATA_UNDERFLOW && err != ERR_MP3_MAINDATA_UNDERFLOW)) {
486486
memset(buffer, 0, self->frame_buffer_size);
487487
*buffer_length = 0;
488488
self->eof = true;

0 commit comments

Comments
 (0)
0