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

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

Issue 2575073002: Guard against uninitialized packetization modes. (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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_h264.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
index e896c65f97269db765d112ce6965b903f4d378bd..15a1d8b1520f094a60611b7469bdf4b2da33fdfe 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
@@ -81,7 +81,11 @@ bool ParseStapAStartOffsets(const uint8_t* nalu_ptr,
RtpPacketizerH264::RtpPacketizerH264(size_t max_payload_len,
H264PacketizationMode packetization_mode)
: max_payload_len_(max_payload_len),
- packetization_mode_(packetization_mode) {}
+ packetization_mode_(packetization_mode) {
+ // Guard against uninitialized memory in packetization_mode.
+ RTC_CHECK(packetization_mode == H264PacketizationMode::NonInterleaved ||
+ packetization_mode == H264PacketizationMode::SingleNalUnit);
+}
RtpPacketizerH264::~RtpPacketizerH264() {
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698