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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1766523002: Fix YUV horizontal and vertical sampling checks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index d36051511c664c14cc9bfeddc642426b7fc24df1..cbe8946b4733dfbf1a21807156a0a67df1c035a1 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -568,10 +568,10 @@ static bool is_yuv_supported(jpeg_decompress_struct* dinfo) {
// that of Y would be an extremely difficult change, given that clients
// allocate memory as if the size of the Y plane is always the size of the
// image. However, this case is very, very rare.
- if (!(1 == dinfo->comp_info[1].h_samp_factor) &&
- (1 == dinfo->comp_info[1].v_samp_factor) &&
- (1 == dinfo->comp_info[2].h_samp_factor) &&
- (1 == dinfo->comp_info[2].v_samp_factor)) {
+ if (!((1 == dinfo->comp_info[1].h_samp_factor) &&
msarett 2016/03/04 00:34:01 A couple characters makes a big difference :). Wh
mtklein 2016/03/04 13:23:27 This may indicate we should De Morgan the logic?
msarett 2016/03/04 13:42:51 Yeah I think that's clearer.
+ (1 == dinfo->comp_info[1].v_samp_factor) &&
+ (1 == dinfo->comp_info[2].h_samp_factor) &&
+ (1 == dinfo->comp_info[2].v_samp_factor))) {
return false;
}
« 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