]> granicus.if.org Git - taglib/commitdiff
Fix possible Ogg packet losses.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 1 Dec 2016 02:32:01 +0000 (11:32 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 1 Dec 2016 02:32:01 +0000 (11:32 +0900)
taglib/ogg/oggfile.cpp

index 86b0b0764ada2092e769372f71977554bc2e2b23..c36e4d46c47a1267655940dc3a4d909a2389710b 100644 (file)
@@ -253,7 +253,7 @@ void Ogg::File::writePacket(unsigned int i, const ByteVector &packet)
   ByteVectorList packets = firstPage->packets();
   packets[i - firstPage->firstPacketIndex()] = packet;
 
-  if(firstPage != lastPage && lastPage->packetCount() > 2) {
+  if(firstPage != lastPage && lastPage->packetCount() > 1) {
     ByteVectorList lastPagePackets = lastPage->packets();
     lastPagePackets.erase(lastPagePackets.begin());
     packets.append(lastPagePackets);