Bug 789075 - Handle odd sized WebM video frames correctly. r=derf

This commit is contained in:
Matthew Gregan 2012-10-16 16:03:43 +13:00
Родитель f41c26f285
Коммит d712138607
5 изменённых файлов: 19 добавлений и 4 удалений

Просмотреть файл

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
</head>
<body>
<video src="789075.webm" onloadedmetadata="document.documentElement.className=undefined"></video>
</body>
</html>

Двоичные данные
content/media/test/crashtests/789075.webm Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -11,3 +11,4 @@ load 576612-1.html
skip-if(Android) load 691096-1.html # Android sound API can't handle playing large number of sounds at once.
load 752784-1.html
HTTP load 795892-1.html
load 789075-1.html

Просмотреть файл

@ -705,14 +705,14 @@ bool nsWebMReader::DecodeVideoFrame(bool &aKeyframeSkip,
b.mPlanes[1].mData = img->planes[1];
b.mPlanes[1].mStride = img->stride[1];
b.mPlanes[1].mHeight = img->d_h >> img->y_chroma_shift;
b.mPlanes[1].mWidth = img->d_w >> img->x_chroma_shift;
b.mPlanes[1].mHeight = (img->d_h + 1) >> img->y_chroma_shift;
b.mPlanes[1].mWidth = (img->d_w + 1) >> img->x_chroma_shift;
b.mPlanes[1].mOffset = b.mPlanes[1].mSkip = 0;
b.mPlanes[2].mData = img->planes[2];
b.mPlanes[2].mStride = img->stride[2];
b.mPlanes[2].mHeight = img->d_h >> img->y_chroma_shift;
b.mPlanes[2].mWidth = img->d_w >> img->x_chroma_shift;
b.mPlanes[2].mHeight = (img->d_h + 1) >> img->y_chroma_shift;
b.mPlanes[2].mWidth = (img->d_w + 1) >> img->x_chroma_shift;
b.mPlanes[2].mOffset = b.mPlanes[2].mSkip = 0;
nsIntRect picture = mPicture;

Просмотреть файл

@ -689,6 +689,12 @@ gfxUtils::ConvertYCbCrToRGB(const PlanarYCbCrImage::Data& aData,
unsigned char* aDestBuffer,
int32_t aStride)
{
// ConvertYCbCrToRGB et al. assume the chroma planes are rounded up if the
// luma plane is odd sized.
MOZ_ASSERT((aData.mCbCrSize.width == aData.mYSize.width ||
aData.mCbCrSize.width == (aData.mYSize.width + 1) >> 1) &&
(aData.mCbCrSize.height == aData.mYSize.height ||
aData.mCbCrSize.height == (aData.mYSize.height + 1) >> 1));
gfx::YUVType yuvtype =
gfx::TypeFromSize(aData.mYSize.width,
aData.mYSize.height,