diff --git a/webrtc/media/base/codec.cc b/webrtc/media/base/codec.cc index 3570ef6527..6cb331a28b 100644 --- a/webrtc/media/base/codec.cc +++ b/webrtc/media/base/codec.cc @@ -315,11 +315,6 @@ bool VideoCodec::ValidateCodecFormat() const { } // Video validation from here on. - - if (width <= 0 || height <= 0) { - LOG(LS_ERROR) << "Codec with invalid dimensions: " << ToString(); - return false; - } int min_bitrate = -1; int max_bitrate = -1; if (GetParam(kCodecParamMinBitrate, &min_bitrate) && diff --git a/webrtc/media/base/codec_unittest.cc b/webrtc/media/base/codec_unittest.cc index ce159ef94a..11717b743a 100644 --- a/webrtc/media/base/codec_unittest.cc +++ b/webrtc/media/base/codec_unittest.cc @@ -348,16 +348,6 @@ TEST(CodecTest, TestValidateCodecFormat) { too_high_payload_type.id = 128; EXPECT_FALSE(too_high_payload_type.ValidateCodecFormat()); - // Reject zero-width codecs. - VideoCodec zero_width = codec; - zero_width.width = 0; - EXPECT_FALSE(zero_width.ValidateCodecFormat()); - - // Reject zero-height codecs. - VideoCodec zero_height = codec; - zero_height.height = 0; - EXPECT_FALSE(zero_height.ValidateCodecFormat()); - // Accept non-video codecs with zero dimensions. VideoCodec zero_width_rtx_codec = VideoCodec::CreateRtxCodec(96, 120); zero_width_rtx_codec.width = 0; diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc index 0a40e0469d..0355cd5273 100644 --- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc +++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc @@ -2518,20 +2518,6 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithMaxQuantization) { EXPECT_EQ(kMaxQuantization, codec.params[kCodecParamMaxQuantization]); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadDimensions) { - cricket::VideoSendParameters parameters; - parameters.codecs.push_back(kVp8Codec); - - parameters.codecs[0].width = 0; - EXPECT_FALSE(channel_->SetSendParameters(parameters)) - << "Codec set though codec width is zero."; - - parameters.codecs[0].width = kVp8Codec.width; - parameters.codecs[0].height = 0; - EXPECT_FALSE(channel_->SetSendParameters(parameters)) - << "Codec set though codec height is zero."; -} - TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadPayloadTypes) { // TODO(pbos): Should we only allow the dynamic range? static const int kIncorrectPayloads[] = {-2, -1, 128, 129};