MAD Decoder: Fix MP3 decoding crash

There was a stupid bug in the previous commit I made, which caused local
or seekable MP3 files to crash the player on decode. This fixes that, by
checking that a packet has actually been decoded before touching the
packet info structures. Dumb, dumb, dumb error on my part.

Fixes #244

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-26 04:26:12 -08:00
parent ca3dec4497
commit a978dfbf5a
1 changed files with 2 additions and 1 deletions

View File

@ -622,6 +622,7 @@
- (int)readAudio:(void *)buffer frames:(UInt32)frames { - (int)readAudio:(void *)buffer frames:(UInt32)frames {
int framesRead = 0; int framesRead = 0;
if(!_firstFrame)
[self syncFormat:YES]; [self syncFormat:YES];
for(;;) { for(;;) {