Merge to XFA: Fix an error 'Use-of-uninitialized-value in CPDF_Function::Call'
authorJUN FANG <jun_fang@foxitsoftware.com>
Thu, 12 Feb 2015 12:38:03 +0000 (04:38 -0800)
committerJUN FANG <jun_fang@foxitsoftware.com>
Thu, 12 Feb 2015 13:06:48 +0000 (05:06 -0800)
This issue was introduced in https://codereview.chromium.org/886953002/.

BUG=454280
R=tsepez@chromium.org

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

core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp

index b112540..ae912ac 100644 (file)
@@ -583,10 +583,10 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
                 }
             } else {
                 FX_SAFE_INT32 bitpos2 = blocksize[i];
-                bitpos2 += 1;
-                bitpos2 *= m_nBitsPerSample; 
+                bitpos2 += pos;
                 bitpos2 *= m_nOutputs;
-                bitpos2 += bitpos.ValueOrDie();
+                bitpos2 += j;
+                bitpos2 *= m_nBitsPerSample; 
                 if (!bitpos2.IsValid()) {
                     return FALSE;
                 }