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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc

Issue 1221643009: Prevent depacketizer OOB reads on zero-length VP8 payload. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
index 804dc0903884eab16aa382c994229fab110b3d69..4283a778d00a072359b384ac6da1f0b92e0d8500 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
@@ -596,4 +596,11 @@ TEST_F(RtpDepacketizerVp8Test, TestWithPacketizer) {
EXPECT_EQ(payload.type.Video.codecHeader.VP8.layerSync,
input_header.layerSync);
}
+
+TEST_F(RtpDepacketizerVp8Test, TestEmptyPayload) {
+ // Using a wild pointer to crash on accesses from inside the depacketizer.
+ uint8_t* garbage_ptr = reinterpret_cast<uint8_t*>(0x4711);
+ RtpDepacketizer::ParsedPayload payload;
+ EXPECT_FALSE(depacketizer_->Parse(&payload, garbage_ptr, 0));
+}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698