Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: core/src/fxcodec/jbig2/JBig2_Image.cpp

Issue 437483004: Fix unninitialized 'tmp' in CJBig2_Image::composeTo_opt2 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_Image.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_Image.cpp b/core/src/fxcodec/jbig2/JBig2_Image.cpp
index 09353c0e81bf0bbd2f6cfdf8b1ea24900bac6057..5da1fc63d0c296c5197ca160488dfdaf2120bb81 100644
--- a/core/src/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Image.cpp
@@ -776,9 +776,14 @@ void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v)
}
FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
{
- FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
- FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
- FX_BYTE *lineSrc, *lineDst, *sp, *dp;
+ FX_INT32 xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0,
+ yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0;
+
+ FX_DWORD s1 = 0, d1 = 0, d2 = 0, shift = 0, shift1 = 0, shift2 = 0,
+ tmp = 0, tmp1 = 0, tmp2 = 0, maskL = 0, maskR = 0, maskM = 0;
+
+ FX_BYTE *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL;
+
if (!m_pData) {
return FALSE;
}
@@ -787,8 +792,6 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y,
}
if(y < 0) {
ys0 = -y;
- } else {
- ys0 = 0;
}
if(y + m_nHeight > pDst->m_nHeight) {
ys1 = pDst->m_nHeight - y;
@@ -797,8 +800,6 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y,
}
if(x < 0) {
xs0 = -x;
- } else {
- xs0 = 0;
}
if(x + m_nWidth > pDst->m_nWidth) {
xs1 = pDst->m_nWidth - x;
@@ -810,14 +811,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y,
}
w = xs1 - xs0;
h = ys1 - ys0;
- if(y < 0) {
- yd0 = 0;
- } else {
+ if(y >= 0) {
yd0 = y;
- }
- if(x < 0) {
- xd0 = 0;
- } else {
+ }
+ if(x >= 0) {
xd0 = x;
}
xd1 = xd0 + w;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698