ZaneDubya / MP3Sharp

MP3 decoder in managed .NET code.
GNU Lesser General Public License v3.0
132 stars 46 forks source link

System.IndexOutOfRangeException in LayerIIIDecoder.HuffmanDecode #28

Open Chicken-Bones opened 3 months ago

Chicken-Bones commented 3 months ago

Using the following mp3 file Music_9.zip

at XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIIIDecoder.HuffmanDecode(Int32 ch, Int32 gr) in Core\Audio\MP3Sharp\Decoding\Decoders\LayerIIIDecoder.cs:line 923
at XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIIIDecoder.Decode() in Core\Audio\MP3Sharp\Decoding\Decoders\LayerIIIDecoder.cs:line 432
at XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIIIDecoder.DecodeFrame() in Core\Audio\MP3Sharp\Decoding\Decoders\LayerIIIDecoder.cs:line 363
at XPT.Core.Audio.MP3Sharp.Decoding.Decoder.DecodeFrame(Header header, Bitstream stream) in Core\Audio\MP3Sharp\Decoding\Decoder.cs:line 134
at XPT.Core.Audio.MP3Sharp.MP3Stream.ReadFrame() in Core\Audio\MP3Sharp\MP3Stream.cs:line 246
at XPT.Core.Audio.MP3Sharp.MP3Stream.Read(Byte[] buffer, Int32 offset, Int32 count) in Core\Audio\MP3Sharp\MP3Stream.cs:line 201
at Terraria.Audio.MP3AudioTrack.ReadAheadPutAChunkIntoTheBuffer() in C:\Work\ReLogic\source\Terraria\Terraria\Terraria\Audio\MP3AudioTrack.cs:line 43
at Terraria.Audio.ASoundEffectBasedAudioTrack.PrepareBuffer() in C:\Work\ReLogic\source\Terraria\Terraria\Terraria\Audio\ASoundEffectBasedAudioTrack.cs:line 65
at Terraria.Audio.ASoundEffectBasedAudioTrack.Update() in C:\Work\ReLogic\source\Terraria\Terraria\Terraria\Audio\ASoundEffectBasedAudioTrack.cs:line 49
at Terraria.Audio.LegacyAudioSystem.Update() in C:\Work\ReLogic\source\Terraria\Terraria\Terraria\Audio\LegacyAudioSystem.cs:line 66
at Terraria.Main.UpdateAudio() in C:\Work\ReLogic\source\Terraria\Terraria\Terraria\Main.cs:line 11709}

Note this is not a duplicate of #3

ZaneDubya commented 2 months ago

Thanks! I will take a look at this soon. Just recovering from a long work streak. :)