void-packages/srcpkgs/icecat/patches/fix-mozilla-bug999496.patch

65 lines
2.0 KiB
Diff

# HG changeset patch
# User Simon Wilper <sxw@cpan.org>
# Date 1400002680 -43200
# Wed May 14 05:38:00 2014 +1200
# Node ID 1f10a80678532ff186f314bb98050fd81f22a7fe
# Parent a54ace627db8f12a9b2c5d3b60a675576887c445
Bug 999496 - Move AudioData::SizeOfIncludingThis to MediaData.cpp. r=kinetik
--- content/media/MediaData.cpp
+++ content/media/MediaData.cpp
@@ -33,16 +33,26 @@ AudioData::EnsureAudioBuffer()
AudioDataValue* data = static_cast<AudioDataValue*>(mAudioBuffer->Data());
for (uint32_t i = 0; i < mFrames; ++i) {
for (uint32_t j = 0; j < mChannels; ++j) {
data[j*mFrames + i] = mAudioData[i*mChannels + j];
}
}
}
+size_t
+AudioData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
+{
+ size_t size = aMallocSizeOf(this) + aMallocSizeOf(mAudioData);
+ if (mAudioBuffer) {
+ size += mAudioBuffer->SizeOfIncludingThis(aMallocSizeOf);
+ }
+ return size;
+}
+
static bool
ValidatePlane(const VideoData::YCbCrBuffer::Plane& aPlane)
{
return aPlane.mWidth <= PlanarYCbCrImage::MAX_DIMENSION &&
aPlane.mHeight <= PlanarYCbCrImage::MAX_DIMENSION &&
aPlane.mWidth * aPlane.mHeight < MAX_VIDEO_WIDTH * MAX_VIDEO_HEIGHT &&
aPlane.mStride > 0;
}
--- content/media/MediaData.h
+++ content/media/MediaData.h
@@ -75,23 +75,17 @@ public:
MOZ_COUNT_CTOR(AudioData);
}
~AudioData()
{
MOZ_COUNT_DTOR(AudioData);
}
- size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
- size_t size = aMallocSizeOf(this) + aMallocSizeOf(mAudioData);
- if (mAudioBuffer) {
- size += mAudioBuffer->SizeOfIncludingThis(aMallocSizeOf);
- }
- return size;
- }
+ size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;
// If mAudioBuffer is null, creates it from mAudioData.
void EnsureAudioBuffer();
const uint32_t mFrames;
const uint32_t mChannels;
// At least one of mAudioBuffer/mAudioData must be non-null.
// mChannels channels, each with mFrames frames