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

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

Issue 1218013002: Prevent OOB reads for zero-length H264 payloads. (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
Index: webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
index 66a19ddf5696a05bf26fae07499655487620bd1c..8fa83010f6f5760282f5ea3b925c57e84fb274d9 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
@@ -537,4 +537,12 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
EXPECT_EQ(kH264FuA, payload.type.Video.codecHeader.H264.packetization_type);
EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type);
}
+
+TEST_F(RtpDepacketizerH264Test, TestEmptyPayload) {
stefan-webrtc 2015/06/30 10:20:03 Seems like we may want to have a few generic tests
pbos-webrtc 2015/06/30 11:22:05 No, since they are different formats the only thin
+ // 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_h264.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698