Skip to content

Commit

Permalink
Fix infinite loop on garbage data at the beginning of AAC files
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Dec 10, 2013
1 parent 1a11397 commit 57ae962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/audiosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ void FFMS_AudioSource::DecodeNextBlock(CacheIterator *pos) {
// during indexing, so continue to just ignore decoding errors
if (Ret < 0) break;

if (Ret > 0 && GotFrame) {
if (Ret > 0) {
Packet.size -= Ret;
Packet.data += Ret;
if (DecodeFrame->nb_samples > 0) {
if (GotFrame && DecodeFrame->nb_samples > 0) {
GotSamples = true;
if (pos)
CacheBlock(*pos);
Expand Down

0 comments on commit 57ae962

Please sign in to comment.