You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found some *.mp3 tracks where ID3 metadata contains COMM frame with frameSize=1. In that case Id3Decoder throws NegativeArraySizeException on parsing such frame.
As I understand it's not illegal to set such data into COMM so player can just skip such frame as it's frameSize is only 1 byte. Other players have no problems with playing such files.
Any device. I've tested on Emulator 6.0 and on Google Pixel 7.1.2
A full bug report captured from the device
Exo code problem and possible fix
This bug occurs because according to ID3 specification COMM frame should contains encoding byte and then language iso (3 bytes). So ID3Decoder (in method decodeCommentFrame) gets byte for encoding, then gets 3 bytes for language iso even if frameSize is less than 4 bytes. Then it is creating byte-array with size=frameSize-4. Then it crashes obviously.
My possible fix is to modify COMM frame decoding condition into ID3Decoder.decodeFrame
I've also removed unnecessary "empty" cases, since to add them
everywhere would bloat the code quite a lot. Note that
new String(new byte[0], 0, 0, encoding) is valid and will produce
and empty string.
Issue: #2663
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152697288
Issue description
I found some *.mp3 tracks where ID3 metadata contains COMM frame with frameSize=1. In that case
Id3Decoder
throwsNegativeArraySizeException
on parsing such frame.As I understand it's not illegal to set such data into COMM so player can just skip such frame as it's frameSize is only 1 byte. Other players have no problems with playing such files.
Reproduction steps
Just play track with such metadata
Link to test content
https://www.dropbox.com/s/qdsxgi8s462jql9/BAD_COMM_SAMPLE.mp3?dl=0
Version of ExoPlayer being used
2.3.1
Device(s) and version(s) of Android being used
Any device. I've tested on Emulator 6.0 and on Google Pixel 7.1.2
A full bug report captured from the device
Exo code problem and possible fix
This bug occurs because according to ID3 specification COMM frame should contains encoding byte and then language iso (3 bytes). So
ID3Decoder
(in methoddecodeCommentFrame
) gets byte for encoding, then gets 3 bytes for language iso even if frameSize is less than 4 bytes. Then it is creating byte-array with size=frameSize-4. Then it crashes obviously.My possible fix is to modify COMM frame decoding condition into
ID3Decoder.decodeFrame
from
to
but maybe it's better to modify
CommentFrame
to contains some default language and empty content for example. don't know...maybe it makes sense to check every frame on it's minimum frameSize to prevent such crashes in other frames decoding code
The text was updated successfully, but these errors were encountered: