| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/pe_image_reader_win.h" | 5 #include "chrome/common/safe_browsing/pe_image_reader_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace safe_browsing { | 9 namespace safe_browsing { |
| 10 | 10 |
| 11 // A class template of traits pertaining to IMAGE_OPTIONAL_HEADER{32,64}. | 11 // A class template of traits pertaining to IMAGE_OPTIONAL_HEADER{32,64}. |
| 12 template<class HEADER_TYPE> | 12 template<class HEADER_TYPE> |
| 13 struct OptionalHeaderTraits { | 13 struct OptionalHeaderTraits { |
| 14 }; | 14 }; |
| 15 | 15 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 if (data_offset >= header->SizeOfRawData || | 324 if (data_offset >= header->SizeOfRawData || |
| 325 header->SizeOfRawData - data_offset < entry->Size) { | 325 header->SizeOfRawData - data_offset < entry->Size) { |
| 326 return NULL; | 326 return NULL; |
| 327 } | 327 } |
| 328 | 328 |
| 329 *data_length = entry->Size; | 329 *data_length = entry->Size; |
| 330 return image_data_ + header->PointerToRawData + data_offset; | 330 return image_data_ + header->PointerToRawData + data_offset; |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace safe_browsing | 333 } // namespace safe_browsing |
| OLD | NEW |