diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 12:51:07 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 12:51:07 +0000 |
commit | 2e9f3b678fd935ddd69e314534c714ae9180842d (patch) | |
tree | 36c9bcf69662b563ded29b1ac7ca9492c3b8dd1c /printing/backend | |
parent | a6539cdfd95230b96139971a4248a5ce79603c93 (diff) | |
download | chromium_src-2e9f3b678fd935ddd69e314534c714ae9180842d.zip chromium_src-2e9f3b678fd935ddd69e314534c714ae9180842d.tar.gz chromium_src-2e9f3b678fd935ddd69e314534c714ae9180842d.tar.bz2 |
Added NULL pointer check for DEVMODE.
BUG=344982
NOTRY=true
Review URL: https://codereview.chromium.org/172813003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/backend')
-rw-r--r-- | printing/backend/win_helper.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index cfc1a58..a16228b 100644 --- a/printing/backend/win_helper.cc +++ b/printing/backend/win_helper.cc @@ -431,7 +431,10 @@ scoped_ptr<DEVMODE[]> CreateDevModeWithColor(HANDLE printer, const base::string16& printer_name, bool color) { scoped_ptr<DEVMODE[]> default = CreateDevMode(printer, NULL); - if (default && (default.get()->dmFields & DM_COLOR) && + if (!default) + return default.Pass(); + + if ((default.get()->dmFields & DM_COLOR) && ((default.get()->dmColor == DMCOLOR_COLOR) == color)) { return default.Pass(); } |