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

Unified Diff: courgette/image_info.cc

Issue 113917: When iterating over the sections in a file, omit sections that have no raw da... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « courgette/image_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/image_info.cc
===================================================================
--- courgette/image_info.cc (revision 17002)
+++ courgette/image_info.cc (working copy)
@@ -58,10 +58,12 @@
const Section* best = 0;
for (int i = 0; i < number_of_sections_; i++) {
const Section* section = &sections_[i];
- if (fileOffset <= section->file_offset_of_raw_data) {
- if (best == 0 ||
- section->file_offset_of_raw_data < best->file_offset_of_raw_data) {
- best = section;
+ if (section->size_of_raw_data > 0) { // i.e. has data in file.
+ if (fileOffset <= section->file_offset_of_raw_data) {
+ if (best == 0 ||
+ section->file_offset_of_raw_data < best->file_offset_of_raw_data) {
+ best = section;
+ }
}
}
}
« no previous file with comments | « courgette/image_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698