Backout 0ae42938a72d (bug 1073350) for build bustage, on a CLOSED TREE
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 01 Oct 2014 18:23:17 -0700
changeset 231524 66ad106fcb6896d1399acbaa7fb1c076624d7bae
parent 231523 0b4ff0427b865e41e57139f1562a4a15eb4d56d1
child 231525 bdf9367d51221bdd2531b8b5289bcec99b9ae12e
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1073350
milestone35.0a1
backs out0ae42938a72d0ed92e44cdda74524fddf641ba9f
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
Backout 0ae42938a72d (bug 1073350) for build bustage, on a CLOSED TREE
content/media/gmp/GMPVideoDecoderParent.cpp
content/media/gmp/GMPVideoi420FrameImpl.cpp
content/media/gmp/GMPVideoi420FrameImpl.h
--- a/content/media/gmp/GMPVideoDecoderParent.cpp
+++ b/content/media/gmp/GMPVideoDecoderParent.cpp
@@ -223,20 +223,16 @@ GMPVideoDecoderParent::ActorDestroy(Acto
 
 bool
 GMPVideoDecoderParent::RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame)
 {
   if (!mCallback) {
     return false;
   }
 
-  if (!CheckFrameData(aDecodedFrame)) {
-    LOGE(("%s: Decoded frame corrupt, ignoring", __FUNCTION__));
-    return false;
-  }
   auto f = new GMPVideoi420FrameImpl(aDecodedFrame, &mVideoHost);
 
   // Ignore any return code. It is OK for this to fail without killing the process.
   mCallback->Decoded(f);
 
   return true;
 }
 
--- a/content/media/gmp/GMPVideoi420FrameImpl.cpp
+++ b/content/media/gmp/GMPVideoi420FrameImpl.cpp
@@ -58,41 +58,16 @@ GMPVideoi420FrameImpl::GetFrameFormat()
 }
 
 void
 GMPVideoi420FrameImpl::Destroy()
 {
   delete this;
 }
 
-/* static */ bool
-CheckFrameData(const GMPVideoi420FrameData& aFrameData)
-{
-  // We may be passed the "wrong" shmem (one smaller than the actual size).
-  // This implies a bug or serious error on the child size.  Ignore this frame if so.
-  // Note: Size() greater than expected is also an error, but with no negative consequences
-  int32_t half_width = (aFrameData.mWidth() + 1) / 2;
-  if ((aFrameData.mYPlane().mStride() <= 0) || (aFrameData.mYPlane().mSize() <= 0) ||
-      (aFrameData.mUPlane().mStride() <= 0) || (aFrameData.mUPlane().mSize() <= 0) ||
-      (aFrameData.mVPlane().mStride() <= 0) || (aFrameData.mVPlane().mSize() <= 0) ||
-      (aFrameData.mYPlane().mSize() > (int32_t) aFrameData.mYPlane().mBuffer().Size<uint8_t>()) ||
-      (aFrameData.mUPlane().mSize() > (int32_t) aFrameData.mUPlane().mBuffer().Size<uint8_t>()) ||
-      (aFrameData.mVPlane().mSize() > (int32_t) aFrameData.mVPlane().mBuffer().Size<uint8_t>()) ||
-      (aFrameData.mYPlane().mStride() < aFrameData.mWidth()) ||
-      (aFrameData.mUPlane().mStride() < half_width) ||
-      (aFrameData.mVPlane().mStride() < half_width) ||
-      (aFrameData.mYPlane().mSize() < aFrameData.mYPlane().mStride() * aFrameData.mHeight()) ||
-      (aFrameData.mUPlane().mSize() < aFrameData.mUPlane().mStride() * ((aFrameData.mHeight()+1)/2)) ||
-      (aFrameData.mVPlane().mSize() < aFrameData.mVPlane().mStride() * ((aFrameData.mHeight()+1)/2)))
-  {
-    return false;
-  }
-  return true;
-}
-
 bool
 GMPVideoi420FrameImpl::CheckDimensions(int32_t aWidth, int32_t aHeight,
                                        int32_t aStride_y, int32_t aStride_u, int32_t aStride_v)
 {
   int32_t half_width = (aWidth + 1) / 2;
   if (aWidth < 1 || aHeight < 1 || aStride_y < aWidth ||
                                    aStride_u < half_width ||
                                    aStride_v < half_width) {
--- a/content/media/gmp/GMPVideoi420FrameImpl.h
+++ b/content/media/gmp/GMPVideoi420FrameImpl.h
@@ -11,19 +11,16 @@
 #include "mozilla/ipc/Shmem.h"
 #include "GMPVideoPlaneImpl.h"
 
 namespace mozilla {
 namespace gmp {
 
 class GMPVideoi420FrameData;
 
-static bool
-CheckFrameData(const GMPVideoi420FrameData& aFrameData);
-
 class GMPVideoi420FrameImpl : public GMPVideoi420Frame
 {
   friend struct IPC::ParamTraits<mozilla::gmp::GMPVideoi420FrameImpl>;
 public:
   explicit GMPVideoi420FrameImpl(GMPVideoHostImpl* aHost);
   GMPVideoi420FrameImpl(const GMPVideoi420FrameData& aFrameData, GMPVideoHostImpl* aHost);
   virtual ~GMPVideoi420FrameImpl();