mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Fix infinite loop in AdtsExtractor sniffing malformed or non-ADTS streams.
Here is a WAV that exhibits this issue: https://storage.googleapis.com/courtside-public/dcower/reaper_16bit_nonbwf.wav ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120334203
This commit is contained in:
parent
157f5ff886
commit
6635dd0ef7
1 changed files with 4 additions and 0 deletions
|
|
@ -102,6 +102,10 @@ public final class AdtsExtractor implements Extractor {
|
|||
input.peekFully(scratch.data, 0, 4);
|
||||
scratchBits.setPosition(14);
|
||||
int frameSize = scratchBits.readBits(13);
|
||||
// Either the stream is malformed OR we're not parsing an ADTS stream.
|
||||
if (frameSize <= 6) {
|
||||
return false;
|
||||
}
|
||||
input.advancePeekPosition(frameSize - 6);
|
||||
validFramesSize += frameSize;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue