Bug 1177243 - Use PodZero rather than memset in WebM decoders. r=rillian
authorMatthew Gregan <kinetik@flim.org>
Thu, 25 Jun 2015 17:23:35 -0700
changeset 250243 492d531ec4868fadb53773bb3d166879696b55d8
parent 250242 62c1c616f21c656a1000a655d889b96fb7195f34
child 250244 a7c6156a485aa71dfcf5328894881a98d9e1f4e8
push id61493
push usermgregan@mozilla.com
push dateFri, 26 Jun 2015 00:23:42 +0000
treeherdermozilla-inbound@492d531ec486 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1177243
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1177243 - Use PodZero rather than memset in WebM decoders. r=rillian
dom/media/webm/IntelWebMVideoDecoder.cpp
dom/media/webm/SoftwareWebMVideoDecoder.cpp
--- a/dom/media/webm/IntelWebMVideoDecoder.cpp
+++ b/dom/media/webm/IntelWebMVideoDecoder.cpp
@@ -195,17 +195,17 @@ IntelWebMVideoDecoder::Demux(nsRefPtr<VP
   unsigned char* data;
   size_t length;
   r = nestegg_packet_data(packet, 0, &data, &length);
   if (r == -1) {
     return false;
   }
 
   vpx_codec_stream_info_t si;
-  memset(&si, 0, sizeof(si));
+  PodZero(&si);
   si.sz = sizeof(si);
   if (mReader->GetVideoCodec() == NESTEGG_CODEC_VP8) {
     vpx_codec_peek_stream_info(vpx_codec_vp8_dx(), data, length, &si);
   } else if (mReader->GetVideoCodec() == NESTEGG_CODEC_VP9) {
     vpx_codec_peek_stream_info(vpx_codec_vp9_dx(), data, length, &si);
   }
 
   MOZ_ASSERT(mPlatform && mMediaDataDecoder);
--- a/dom/media/webm/SoftwareWebMVideoDecoder.cpp
+++ b/dom/media/webm/SoftwareWebMVideoDecoder.cpp
@@ -25,17 +25,17 @@ namespace mozilla {
 using namespace gfx;
 using namespace layers;
 
 SoftwareWebMVideoDecoder::SoftwareWebMVideoDecoder(WebMReader* aReader)
   : WebMVideoDecoder(),
     mReader(aReader)
 {
   MOZ_COUNT_CTOR(SoftwareWebMVideoDecoder);
-  memset(&mVPX, 0, sizeof(vpx_codec_ctx_t));
+  PodZero(&mVPX);
 }
 
 SoftwareWebMVideoDecoder::~SoftwareWebMVideoDecoder()
 {
   MOZ_COUNT_DTOR(SoftwareWebMVideoDecoder);
 }
 
 void
@@ -123,17 +123,17 @@ SoftwareWebMVideoDecoder::DecodeVideoFra
   unsigned char* data;
   size_t length;
   r = nestegg_packet_data(packet, 0, &data, &length);
   if (r == -1) {
     return false;
   }
 
   vpx_codec_stream_info_t si;
-  memset(&si, 0, sizeof(si));
+  PodZero(&si);
   si.sz = sizeof(si);
   if (mReader->GetVideoCodec() == NESTEGG_CODEC_VP8) {
     vpx_codec_peek_stream_info(vpx_codec_vp8_dx(), data, length, &si);
   } else if (mReader->GetVideoCodec() == NESTEGG_CODEC_VP9) {
     vpx_codec_peek_stream_info(vpx_codec_vp9_dx(), data, length, &si);
   }
   if (aKeyframeSkip && (!si.is_kf || tstamp < aTimeThreshold)) {
     // Skipping to next keyframe...