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

Unified Diff: core/src/fxcodec/codec/fx_codec_jpx_opj.cpp

Issue 648823002: Fix a bug when image width is odd in sycc422_to_rgb (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 2 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/codec/fx_codec_jpx_opj.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index 32adb8e3e4d0864d0f04d034c96569e32fe265d0..1180bfc102ab1d36b2840c4829ac20c3baf24a80 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -167,19 +167,12 @@ static void sycc422_to_rgb(opj_image_t *img)
d1 = g = FX_Alloc(int, (size_t)max);
d2 = b = FX_Alloc(int, (size_t)max);
for(i = 0; i < maxh; ++i) {
- for(j = 0; j < maxw; j += 2) {
+ for (j = 0; j < maxw; ++j, ++y, ++r, ++g, ++b) {
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- ++cb;
- ++cr;
+ if (j % 2){
+ ++cb;
+ ++cr;
+ }
}
}
FX_Free(img->comps[0].data);
« 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