Bug 571208 - Fix crash in nestegg_free_packet. Only push non-NULL packets into packet queue. r=chris.double

This commit is contained in:
Matthew Gregan 2010-06-11 10:59:15 +12:00
parent 98d3104c6f
commit d562484ebd
2 changed files with 3 additions and 2 deletions

View File

@ -531,14 +531,13 @@ PRBool nsWebMReader::DecodeVideoFrame(PRBool &aKeyframeSkip,
nestegg_free_packet(next_packet);
return PR_FALSE;
}
mVideoPackets.PushFront(next_packet);
} else {
r = nestegg_duration(mContext, &next_tstamp);
if (r == -1) {
nestegg_free_packet(next_packet);
return PR_FALSE;
}
}
mVideoPackets.PushFront(next_packet);
}
PRInt64 tstamp_ms = tstamp / NS_PER_MS;

View File

@ -74,10 +74,12 @@ class PacketQueue : private nsDeque {
}
inline void Push(nestegg_packet* aItem) {
NS_ASSERTION(aItem, "NULL pushed to PacketQueue");
nsDeque::Push(aItem);
}
inline void PushFront(nestegg_packet* aItem) {
NS_ASSERTION(aItem, "NULL pushed to PacketQueue");
nsDeque::PushFront(aItem);
}