Assert when running SampleApp with msaa 16 on Windows 10
authoraleksandar.stojiljkovic <aleksandar.stojiljkovic@intel.com>
Thu, 5 Nov 2015 15:48:12 +0000 (07:48 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Nov 2015 15:48:12 +0000 (07:48 -0800)
Trivial: skip calling SkWGLExtensions::selectFormat with 0 elements,
 and handle if called.

BUG=4529

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

src/utils/win/SkWGL_win.cpp

index bc22795e2ffb3bb57f2240b492f92004ca512a55..5afcae94cec4f82303923d6bfb0b2ccd056cd64c 100644 (file)
@@ -126,6 +126,9 @@ int SkWGLExtensions::selectFormat(const int formats[],
                                   int formatCount,
                                   HDC dc,
                                   int desiredSampleCount) const {
+    if (formatCount <= 0) {
+        return -1;
+    }
     PixelFormat desiredFormat = {
         0,
         desiredSampleCount,