Skip to content

Commit

Permalink
Fix a crash sorting without enough data
Browse files Browse the repository at this point in the history
  • Loading branch information
edman007 committed Sep 9, 2020
1 parent 038b8dd commit f32a02e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stream_unwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ bool StreamUnwrap::charge_reorder_queue(void){
}

void StreamUnwrap::sort_reorder_queue(void){
if (reorder_queue.size() < 2){
//nothing to sort if it's this small
return;
}
auto av_old_back = reorder_queue.end();
std::advance(av_old_back, -2);
AVPacket &old_back = *av_old_back;
Expand Down

0 comments on commit f32a02e

Please sign in to comment.