Bug 980810 - Part 1: Fix clang -Wstring-conversion warnings in WebM container writer. r=rillian
authorChris Peterson <cpeterson@mozilla.com>
Fri, 07 Mar 2014 00:49:34 -0800
changeset 190858 8dde2a011bd9c91564dbe10df5f55bf039de0f8f
parent 190857 f81c8b82ac70895f0fa3ea0d88b17d0eb3aaf6a9
child 190859 399e4c0b9a6ff902525301ee7853e4c495cc92a0
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs980810
milestone30.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 980810 - Part 1: Fix clang -Wstring-conversion warnings in WebM container writer. r=rillian
content/media/webm/EbmlComposer.cpp
--- a/content/media/webm/EbmlComposer.cpp
+++ b/content/media/webm/EbmlComposer.cpp
@@ -51,18 +51,18 @@ void EbmlComposer::GenerateHeader()
                             mCodecPrivateData.Length());
           }
         }
         Ebml_EndSubElement(&ebml, &trackLoc);
       }
     }
     // The Recording length is unknow and ignore write the whole Segment element size
   }
-  MOZ_ASSERT_IF(ebml.offset > DEFAULT_HEADER_SIZE + mCodecPrivateData.Length(),
-                "write more data > EBML_BUFFER_SIZE");
+  MOZ_ASSERT(ebml.offset <= DEFAULT_HEADER_SIZE + mCodecPrivateData.Length(),
+             "write more data > EBML_BUFFER_SIZE");
   mClusterBuffs.AppendElement();
   mClusterBuffs.LastElement().SetLength(ebml.offset);
   memcpy(mClusterBuffs.LastElement().Elements(), ebml.buf, ebml.offset);
 }
 
 void EbmlComposer::FinishCluster()
 {
   MOZ_ASSERT(mClusterLengthLoc > 0 );
@@ -112,18 +112,18 @@ EbmlComposer::WriteSimpleBlock(EncodedFr
                      EncodedFrame::FrameType::VP8_I_FRAME,
                      0, 0, (unsigned char*)aFrame->GetFrameData().Elements(),
                      aFrame->GetFrameData().Length());
   } else {
     writeSimpleBlock(&ebml, 0x2, 0, false,
                      0, 0, (unsigned char*)aFrame->GetFrameData().Elements(),
                      aFrame->GetFrameData().Length());
   }
-  MOZ_ASSERT_IF(ebml.offset > DEFAULT_HEADER_SIZE + aFrame->GetFrameData().Length(),
-                "write more data > EBML_BUFFER_SIZE");
+  MOZ_ASSERT(ebml.offset <= DEFAULT_HEADER_SIZE + aFrame->GetFrameData().Length(),
+             "write more data > EBML_BUFFER_SIZE");
   mClusterBuffs.LastElement().SetLength(ebml.offset);
 }
 
 void
 EbmlComposer::SetVideoConfig(uint32_t aWidth, uint32_t aHeight,
                              uint32_t aDisplayWidth, uint32_t aDisplayHeight,
                              float aFrameRate)
 {