all in the gyp
authormtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Jul 2013 16:20:05 +0000 (16:20 +0000)
committermtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Jul 2013 16:20:05 +0000 (16:20 +0000)
BUG=
R=caryclark@google.com

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

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

gyp/common_conditions.gypi
src/images/SkImageDecoder_libjpeg.cpp

index 2dcd36c..6828660 100644 (file)
               ],
             },
           }],
+# This old compiler is really bad at figuring out when things are uninitialized, so ignore it.
+          [ '<(mac_sdk)==10.6', {
+            'xcode_settings': {
+              'OTHER_CPLUSPLUSFLAGS': [
+                '-Wno-uninitialized',
+              ],
+            },
+          }],
         ],
         'configurations': {
           'Debug': {
index 0a016e5..e0783c9 100644 (file)
@@ -917,11 +917,6 @@ protected:
         SkAutoTime atm("JPEG Encode");
 #endif
 
-        const WriteScanline writer = ChooseWriter(bm);
-        if (NULL == writer) {
-            return false;
-        }
-
         SkAutoLockPixels alp(bm);
         if (NULL == bm.getPixels()) {
             return false;
@@ -940,8 +935,14 @@ protected:
         if (setjmp(sk_err.fJmpBuf)) {
             return false;
         }
-        jpeg_create_compress(&cinfo);
 
+        // Keep after setjmp or mark volatile.
+        const WriteScanline writer = ChooseWriter(bm);
+        if (NULL == writer) {
+            return false;
+        }
+
+        jpeg_create_compress(&cinfo);
         cinfo.dest = &sk_wstream;
         cinfo.image_width = bm.width();
         cinfo.image_height = bm.height();