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

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

Issue 2291813002: Skip the channel if there is no data. (Closed)
Patch Set: Created 4 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/fxcodec/codec/fx_codec_jpx_opj.cpp
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index 9e72c509d7023abe2396fbc9b8f270ed082b0d2f..ed9331974d68dba971336410310c6ebe71518272 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -835,6 +835,9 @@ bool CJPX_Decoder::Decode(uint8_t* dest_buf,
uint8_t* pScanline = pChannel + row * pitch;
for (int col = 0; col < width; ++col) {
uint8_t* pPixel = pScanline + col * image->numcomps;
+ if (!image->comps[channel].data)
+ continue;
+
int src = image->comps[channel].data[row * width + col];
src += image->comps[channel].sgnd
? 1 << (image->comps[channel].prec - 1)
@@ -851,9 +854,9 @@ bool CJPX_Decoder::Decode(uint8_t* dest_buf,
uint8_t* pScanline = pChannel + row * pitch;
for (int col = 0; col < width; ++col) {
uint8_t* pPixel = pScanline + col * image->numcomps;
- if (!image->comps[channel].data) {
+ if (!image->comps[channel].data)
continue;
- }
+
int src = image->comps[channel].data[row * width + col];
src += image->comps[channel].sgnd
? 1 << (image->comps[channel].prec - 1)
« 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