Fixes coverity warnings.
BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/566014 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2262 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
		| @@ -20,6 +20,7 @@ namespace test { | |||||||
| RtpFormatVp8TestHelper::RtpFormatVp8TestHelper(const RTPVideoHeaderVP8* hdr) | RtpFormatVp8TestHelper::RtpFormatVp8TestHelper(const RTPVideoHeaderVP8* hdr) | ||||||
|     : payload_data_(NULL), |     : payload_data_(NULL), | ||||||
|       buffer_(NULL), |       buffer_(NULL), | ||||||
|  |       data_ptr_(NULL), | ||||||
|       fragmentation_(NULL), |       fragmentation_(NULL), | ||||||
|       hdr_info_(hdr), |       hdr_info_(hdr), | ||||||
|       sloppy_partitioning_(false), |       sloppy_partitioning_(false), | ||||||
| @@ -67,7 +68,7 @@ void RtpFormatVp8TestHelper::GetAllPacketsAndCheck( | |||||||
|     int expected_num_packets) { |     int expected_num_packets) { | ||||||
|   ASSERT_TRUE(inited_); |   ASSERT_TRUE(inited_); | ||||||
|   int send_bytes = 0; |   int send_bytes = 0; | ||||||
|   bool last; |   bool last = false; | ||||||
|   for (int i = 0; i < expected_num_packets; ++i) { |   for (int i = 0; i < expected_num_packets; ++i) { | ||||||
|     std::ostringstream ss; |     std::ostringstream ss; | ||||||
|     ss << "Checking packet " << i; |     ss << "Checking packet " << i; | ||||||
|   | |||||||
| @@ -79,7 +79,6 @@ int VP8Encoder::Release() { | |||||||
|   } |   } | ||||||
|   if (raw_ != NULL) { |   if (raw_ != NULL) { | ||||||
|     vpx_img_free(raw_); |     vpx_img_free(raw_); | ||||||
|     delete raw_; |  | ||||||
|     raw_ = NULL; |     raw_ = NULL; | ||||||
|   } |   } | ||||||
| #if WEBRTC_LIBVPX_VERSION >= 971 | #if WEBRTC_LIBVPX_VERSION >= 971 | ||||||
| @@ -153,9 +152,6 @@ int VP8Encoder::InitEncode(const VideoCodec* inst, | |||||||
|   if (config_ == NULL) { |   if (config_ == NULL) { | ||||||
|     config_ = new vpx_codec_enc_cfg_t; |     config_ = new vpx_codec_enc_cfg_t; | ||||||
|   } |   } | ||||||
|   if (raw_ == NULL) { |  | ||||||
|     raw_ = new vpx_image_t; |  | ||||||
|   } |  | ||||||
|   timestamp_ = 0; |   timestamp_ = 0; | ||||||
|  |  | ||||||
|   codec_ = *inst; |   codec_ = *inst; | ||||||
| @@ -178,7 +174,7 @@ int VP8Encoder::InitEncode(const VideoCodec* inst, | |||||||
|   encoded_image_._buffer = new uint8_t[encoded_image_._size]; |   encoded_image_._buffer = new uint8_t[encoded_image_._size]; | ||||||
|   encoded_image_._completeFrame = true; |   encoded_image_._completeFrame = true; | ||||||
|  |  | ||||||
|   vpx_img_alloc(raw_, IMG_FMT_I420, codec_.width, codec_.height, 32); |   raw_ = vpx_img_alloc(NULL, IMG_FMT_I420, codec_.width, codec_.height, 32); | ||||||
|   // populate encoder configuration with default values |   // populate encoder configuration with default values | ||||||
|   if (vpx_codec_enc_config_default(vpx_codec_vp8_cx(), config_, 0)) { |   if (vpx_codec_enc_config_default(vpx_codec_vp8_cx(), config_, 0)) { | ||||||
|     return WEBRTC_VIDEO_CODEC_ERROR; |     return WEBRTC_VIDEO_CODEC_ERROR; | ||||||
| @@ -709,7 +705,8 @@ int VP8Decoder::Decode(const EncodedImage& input_image, | |||||||
|         propagation_cnt_ = 0; |         propagation_cnt_ = 0; | ||||||
|       return WEBRTC_VIDEO_CODEC_ERROR; |       return WEBRTC_VIDEO_CODEC_ERROR; | ||||||
|     } |     } | ||||||
|     img = vpx_codec_get_frame(decoder_, &iter); |     // We don't render this frame. | ||||||
|  |     vpx_codec_get_frame(decoder_, &iter); | ||||||
|     iter = NULL; |     iter = NULL; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 stefan@webrtc.org
					stefan@webrtc.org