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

Side by Side 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, 5 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 EXPECT_EQ(kRtpVideoVp8, payload.type.Video.codec); 589 EXPECT_EQ(kRtpVideoVp8, payload.type.Video.codec);
590 VerifyBasicHeader(&payload.type, 1, 1, 0); 590 VerifyBasicHeader(&payload.type, 1, 1, 0);
591 VerifyExtensions(&payload.type, 591 VerifyExtensions(&payload.type,
592 input_header.pictureId, 592 input_header.pictureId,
593 input_header.tl0PicIdx, 593 input_header.tl0PicIdx,
594 input_header.temporalIdx, 594 input_header.temporalIdx,
595 input_header.keyIdx); 595 input_header.keyIdx);
596 EXPECT_EQ(payload.type.Video.codecHeader.VP8.layerSync, 596 EXPECT_EQ(payload.type.Video.codecHeader.VP8.layerSync,
597 input_header.layerSync); 597 input_header.layerSync);
598 } 598 }
599
600 TEST_F(RtpDepacketizerVp8Test, TestEmptyPayload) {
601 // Using a wild pointer to crash on accesses from inside the depacketizer.
602 uint8_t* garbage_ptr = reinterpret_cast<uint8_t*>(0x4711);
603 RtpDepacketizer::ParsedPayload payload;
604 EXPECT_FALSE(depacketizer_->Parse(&payload, garbage_ptr, 0));
605 }
599 } // namespace webrtc 606 } // namespace webrtc
OLDNEW
« 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