Fixing clusterfuzz issue
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 May 2014 17:32:50 +0000 (17:32 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 May 2014 17:32:50 +0000 (17:32 +0000)
When reading an SkSSE2ProcCoeffXfermode object, fProcSIMD should never be NULL. The reason for this is that it's not possible to create such an object through SkPlatformXfermodeFactory_impl_SSE2(), which is the only function used to create these objects, so if we're reading one, it's clearly invalid.

BUG=379181
R=reed@google.com, mtklein@google.com

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/306183002

git-svn-id: http://skia.googlecode.com/svn/trunk@15000 2bbb7eff-a529-9590-31e7-b0007b416f81

src/opts/SkXfermode_opts_SSE2.cpp

index ec76ab3..94f9a4a 100644 (file)
@@ -644,6 +644,7 @@ extern SkXfermodeProcSIMD gSSE2XfermodeProcs[];
 SkSSE2ProcCoeffXfermode::SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer)
     : INHERITED(buffer) {
     fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]);
+    buffer.validate(fProcSIMD != NULL);
 }
 
 void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[],