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

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

Issue 2334823002: Verify value of prec before using (Closed)
Patch Set: Created 4 years, 3 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 ed9331974d68dba971336410310c6ebe71518272..5f81b059731c714008bc61e402c7ead1ca231229 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -231,6 +231,9 @@ static void sycc422_to_rgb(opj_image_t* img) {
return;
int prec = img->comps[0].prec;
+ if (prec >= 32)
Tom Sepez 2016/09/12 18:37:36 what if its < 0 ?
dsinclair 2016/09/12 19:46:59 Done. Checked for <= 0 as we do prec - 1 below.
+ return;
+
int offset = 1 << (prec - 1);
int upb = (1 << 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