Don't crash if we ask for packet count of an invalid stream

pull/3172/head
Isaac Connor 2021-02-18 13:43:58 -05:00
parent c7dede0083
commit 127e15ba3a
1 changed files with 4 additions and 0 deletions

View File

@ -420,6 +420,10 @@ unsigned int PacketQueue::size() {
}
int PacketQueue::packet_count(int stream_id) {
if ( stream_id < 0 or stream_id > max_stream_id ) {
Error("Invalid stream_id %d", stream_id);
return -1;
}
return packet_counts[stream_id];
} // end int PacketQueue::packet_count(int stream_id)