Skip to content

Commit

Permalink
Fix ArrayIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyrikunov committed Aug 1, 2017
1 parent f589ee5 commit dc2664c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public ByteBuffer asByteBuffer() {

@Override
public SampleEntry getSampleEntry() {
return sampleEntries.get(l2i(tfhd.getSampleDescriptionIndex()-1));
return sampleEntries.get(l2i(Math.max(0, tfhd.getSampleDescriptionIndex()-1)));
}
};
sampleCache[index] = new SoftReference<>(sample);
Expand Down

0 comments on commit dc2664c

Please sign in to comment.