Skip to content

Commit 726639b

Browse files
authored
Merge pull request adafruit#9653 from eric321/mp3-partial-frame-fix
Fix infinite loop when there's a partial frame at the end of the file.
2 parents cda1947 + ca53f8b commit 726639b

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy