Fix undefined behavior in FrameBuffer

Bug: none
Change-Id: I7ce6298a27dc9e79e5f5a85103b3f1dd7b4be71e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131953
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27527}
This commit is contained in:
Ilya Nikolaevskiy
2019-04-09 19:23:36 +02:00
committed by Commit Bot
parent 6a489f22c7
commit f87a7dfb42

View File

@ -352,10 +352,11 @@ bool FrameBuffer::IsCompleteSuperFrame(const EncodedFrame& frame) {
if (prev_frame == frames_.end())
return false;
while (prev_frame->second.frame->inter_layer_predicted) {
if (prev_frame == frames_.begin())
return false;
--prev_frame;
--id.spatial_layer;
if (prev_frame == frames_.end() ||
prev_frame->first.picture_id != id.picture_id ||
if (prev_frame->first.picture_id != id.picture_id ||
prev_frame->first.spatial_layer != id.spatial_layer) {
return false;
}