libeplayer3/writer/pcm.cpp: break potential infinite loop

This commit is contained in:
martii
2014-05-24 13:05:16 +02:00
parent 8ae08d022c
commit 9ac03e1046

View File

@@ -311,8 +311,11 @@ bool WriterPCM::Write(AVPacket *packet, int64_t pts)
break; break;
} }
if (packet->data)
packet_size -= len;
if (!got_frame) { if (!got_frame) {
if (!packet->data) if (!packet->data || !packet_size)
break; break;
continue; continue;
} }
@@ -338,9 +341,6 @@ bool WriterPCM::Write(AVPacket *packet, int64_t pts)
} }
pts = 0; pts = 0;
if (packet->data)
packet_size -= len;
} }
return !packet_size; return !packet_size;
} }