diff options
author | Bill Richardson <wfrichar@chromium.org> | 2011-09-08 10:14:14 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2011-09-08 10:27:45 -0700 |
commit | 209166af0d6e8e21f6c462ea19fbcfc6c933ea78 (patch) | |
tree | 92171681fb0c6326ffa971f576c65475effda259 | |
parent | d2ae48a546be763c98b7187e1484cd25e0062cab (diff) | |
download | vboot-209166af0d6e8e21f6c462ea19fbcfc6c933ea78.tar.gz |
Fix bug in recognizing bad image files.
BUG=none
TEST=manual
make
make runtests
Change-Id: I8456c25187e01666cc46bad50813e8a4d268f1bc
Reviewed-on: http://gerrit.chromium.org/gerrit/7409
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | tests/bitmaps/FontFile.bin | bin | 0 -> 2608 bytes | |||
-rw-r--r-- | tests/bitmaps/case_badbmp.yaml | 4 | ||||
-rw-r--r-- | utility/image_types.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/tests/bitmaps/FontFile.bin b/tests/bitmaps/FontFile.bin Binary files differnew file mode 100644 index 00000000..5ca0ea8a --- /dev/null +++ b/tests/bitmaps/FontFile.bin diff --git a/tests/bitmaps/case_badbmp.yaml b/tests/bitmaps/case_badbmp.yaml index 1222aaf8..c4571ff9 100644 --- a/tests/bitmaps/case_badbmp.yaml +++ b/tests/bitmaps/case_badbmp.yaml @@ -1,15 +1,17 @@ # Invalid specification: requests missing image file. -bmpblock: 1.0 +bmpblock: 1.2 # These are the individual images which are layered to produce a screen layout. images: devmode: NotReallyA.bmp + $HWID: FontFile.bin # These are all of the distinct layouts that we know how to display. screens: dev_en: - [0, 0, devmode] + - [100, 100, $HWID] # To customize the images for a particular locale, just reorder this list so diff --git a/utility/image_types.c b/utility/image_types.c index 2cc27b32..8fcd94ed 100644 --- a/utility/image_types.c +++ b/utility/image_types.c @@ -65,7 +65,7 @@ ImageFormat identify_image_type(const void *buf, uint32_t bufsize, return FORMAT_FONT; } - return FORMAT_BMP; + return FORMAT_INVALID; } |