fixed various segfaults in decoder and renderer

This commit is contained in:
itsmattkc
2020-05-18 02:40:58 +10:00
parent a0f2035240
commit 814bbe8c22
22 changed files with 255 additions and 193 deletions
+6 -5
View File
@@ -38,17 +38,18 @@ public:
void AppendTimewise(const ViewerPlaybackFrame& f, int playback_speed)
{
if (this->isEmpty() || f.timestamp > this->last().timestamp == playback_speed > 0) {
reverse_iterator i = this->rbegin();
if (this->isEmpty() || (this->last().timestamp < f.timestamp) == (playback_speed > 0)) {
this->append(f);
} else {
reverse_iterator i = this->rbegin();
while (i != this->rend()) {
reverse_iterator next = i + 1;
if (next->timestamp < f.timestamp == playback_speed > 0) {
if ((next->timestamp < f.timestamp) == (playback_speed > 0)) {
this->insert(i.base(), f);
break;
return;
} else {
i = next;
}