Bug 979812 - Check the PlanarYCbCrImage data is valid. r=rillian

This commit is contained in:
Benjamin Chen 2014-03-17 14:57:10 +08:00
parent 8b12dfab8f
commit e4210a18a6

View File

@ -290,6 +290,10 @@ nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk)
// Big-time assumption here that this is all contiguous data coming
// from getUserMedia or other sources.
MOZ_ASSERT(yuv);
if (!yuv->IsValid()) {
NS_WARNING("PlanarYCbCrImage is not valid");
return NS_ERROR_FAILURE;
}
const PlanarYCbCrImage::Data *data = yuv->GetData();
if (isYUV420(data) && !data->mCbSkip) { // 420 planar