Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: webrtc/modules/video_coding/frame_buffer2.cc

Issue 3012883002: Don't treat picture ids as wrapping in the FrameBuffer2 class. (Closed)
Patch Set: . Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/frame_buffer2.cc
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
index f314ccb5f6461f3c05a17ff4f2873ab9e942a163..5b81c5f997bb833f13067eb080c4237b2b77bfe9 100644
--- a/webrtc/modules/video_coding/frame_buffer2.cc
+++ b/webrtc/modules/video_coding/frame_buffer2.cc
@@ -248,9 +248,13 @@ void FrameBuffer::Stop() {
}
bool FrameBuffer::ValidReferences(const FrameObject& frame) const {
+ if (frame.picture_id < 0)
terelius 2017/09/11 16:10:22 What does it mean if we get frame with negative pi
+ return false;
+
for (size_t i = 0; i < frame.num_references; ++i) {
- if (AheadOrAt<uint16_t>(frame.references[i], frame.picture_id))
+ if (frame.references[i] < 0 || frame.references[i] >= frame.picture_id)
return false;
+
for (size_t j = i + 1; j < frame.num_references; ++j) {
if (frame.references[i] == frame.references[j])
return false;

Powered by Google App Engine
This is Rietveld 408576698