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,7 +622,8 @@
- (int)readAudio:(void *)buffer frames:(UInt32)frames {
int framesRead = 0;
[self syncFormat:YES];
if(!_firstFrame)
[self syncFormat:YES];
for(;;) {
long framesRemaining = frames - framesRead;