Fix uninitialized variable. If FindConstraint() returns false, we check |value| in two places and at that point, it can hold an uninitialized value. Caught by Linux Memcheck builder.
http://chromegw.corp.google.com/i/client.webrtc/builders/Linux%20Memcheck/builds/3351/steps/libjingle_peerconnection_unittest/logs/0A34BA777AB03D08
TBR=perkj@webrtc.org
BUG=
Review URL: https://webrtc-codereview.appspot.com/43579004
Cr-Commit-Position: refs/heads/master@{#8611}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8611 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/mediastreamsignaling.cc b/talk/app/webrtc/mediastreamsignaling.cc
index 3c31121..1f5f14f 100644
--- a/talk/app/webrtc/mediastreamsignaling.cc
+++ b/talk/app/webrtc/mediastreamsignaling.cc
@@ -54,7 +54,7 @@
static bool ParseConstraintsForAnswer(
const MediaConstraintsInterface* constraints,
cricket::MediaSessionOptions* options) {
- bool value;
+ bool value = false;
size_t mandatory_constraints_satisfied = 0;
// kOfferToReceiveAudio defaults to true according to spec.
@@ -67,6 +67,7 @@
// kOfferToReceiveVideo defaults to false according to spec. But
// if it is an answer and video is offered, we should still accept video
// per default.
+ value = false;
if (!FindConstraint(constraints,
MediaConstraintsInterface::kOfferToReceiveVideo,
&value, &mandatory_constraints_satisfied) || value) {