Fix crash issue when we decode some bmp 34/272534/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 18 Mar 2022 08:18:38 +0000 (17:18 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 18 Mar 2022 10:43:34 +0000 (19:43 +0900)
Some code use 'char' instead of 'unsigned char'.
and next, try to convert that value as 'unsigned int'
If char value was 255 (== -1), converted value become INT_MAX.

This patch make BMP decoder use correct data format

Change-Id: I4f08e28c916eb34f2d06da452b6dde6638d1789b
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/images/flag-24bpp.bmp.buffer [moved from automated-tests/images/flag-24bpp.buffer with 100% similarity]
automated-tests/images/w3c_home_256.bmp [new file with mode: 0755]
automated-tests/images/w3c_home_256.bmp.buffer [new file with mode: 0644]
automated-tests/src/dali-adaptor-internal/utc-Dali-BmpLoader.cpp
dali/internal/imaging/common/loader-bmp.cpp

diff --git a/automated-tests/images/w3c_home_256.bmp b/automated-tests/images/w3c_home_256.bmp
new file mode 100755 (executable)
index 0000000..4b714ff
Binary files /dev/null and b/automated-tests/images/w3c_home_256.bmp differ
diff --git a/automated-tests/images/w3c_home_256.bmp.buffer b/automated-tests/images/w3c_home_256.bmp.buffer
new file mode 100644 (file)
index 0000000..ecee152
--- /dev/null
@@ -0,0 +1 @@
+\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\8c\8a\8c\8c\8a\8c\8c\8a\8ctvt¼º¼üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\8c\8a\8cÌÎÌ\8c\8a\8c\8c\8a\8cÌÎÌ\8c\8a\8cÌÎÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\8c\8a\8cüþüDFDìîìDFDüþü\8c\8a\8cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\8c\8a\8cüþü$"$DFD¼º¼üþü\8c\8a\8cüþüüþüìòüÄÎäÄÎäÄÎäÄÎäìòüüþüüþüüþüüþüüþüüþüÜæôÄÎäÄÎäÄÎäÄÎäüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü¼Æä\94ªÔ\94ªÔ\94ªÔ¤¶ÜÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäÄÎäìòüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÌÎÌüþüüþütvtüþüDFDÌÎÌDFDÜÞÜ\8c\8a\8cüþüüþüÜæô\fF\9c\fF\9c\fF\9c\fF\9c¤¶ÜüþüüþüüþüüþüüþüüþüÔÚì\fF\9c\fF\9c\fF\9c\fF\9cÄÎäüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9cÄÎäüþüüþüüþüüþüüþüÌÎÌLNL\ 4\ 2\ 4\f\ e\f\^\ÜÞÜüþüüþüüþüìîì,.,üþüüþü¼º¼\8c\8a\8cüþüüþüìîìtvtìîìüþüüþüüþü$Z¬\fF\9c\fF\9c\fF\9cd\8aÄüþüüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\14N¤t\96ÄüþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\fB\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cÄÎäüþüüþüüþüüþü\9c\9e\9c\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\9c\9e\9cüþüüþü|~|\ 4\ 2\ 4üþüüþüüþüÌÎÌ\8c\8a\8c\8c\8a\8c\8c\8a\8cìîìüþüüþüüþüüþüt\96Ä\14\fF\9c\fF\9c\14N¤üþüüþüüþüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c$Z¬üþüüþüüþüüþüüþüüþüüþüüþüüþüt\96Ä\fB\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\14N¤Dr´üþüüþüüþüüþüÌÎÌ\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4¼º¼ìîì\f\ e\f\ 4\ 2\ 4¼¾¼üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\fF\9c\fF\9c\fF\9c\14N¤ÔÚìüþüüþüüþüüþüüþüüþü¤¶Ü\fF\9c\fF\9c\fF\9c\fF\9cÜæôüþüüþüüþüüþüüþüüþüüþüüþü4f¬\fB\9c\14\fF\9c\fF\9c\14\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cÄÎäüþüüþüüþüüþü\1c\1e\1c\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\1c\1e\1clnl\ 4\ 2\ 4\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\fF\9ct\96Äüþüüþüüþüüþüüþüüþüìòü\fF\9c\fF\9c\fF\9c\fF\9c\94ªÔüþüüþüüþüüþüüþüüþüüþüÜæô\fF\9c\fF\9c\fF\9c\fF\9cl\8aÄüþüüþüüþüüþüüþü´Âä\fF\9c\fF\9c\fF\9c\fF\9cd\8aÄüþüüþüüþüüþü\9c\9e\9c\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4,.,|~|lnl$"$\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\f\ e\fìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüT~¼\fF\9c\fF\9c\fF\9c4f¬üþüüþüüþüüþüüþüüþüüþüDr´\fF\9c\14\fF\9cT~¼üþüüþüüþüüþüüþüüþüüþü\94ªÔ\fF\9c\fF\9c\fF\9c\fF\9cìòüüþüüþüüþüüþüüþü$Z¬\fF\9c\fF\9c\fF\9c\14N¤ìòüüþüüþüüþüüþü<><\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüìîì\^\\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4|~|üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü¤¶Ü\fF\9c\fF\9c\14\fF\9cÜæôüþüüþüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c\fF\9cìòüüþüüþüüþüüþüüþüüþüT~¼\fF\9c\fB\9c\fF\9c<j´üþüüþüüþüüþüüþü\84\9eÌ\fF\9c\14\fF\9c\fF\9c\84\9eÌüþüüþüüþüüþüìîì\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþü\^\\ 4\ 2\ 4\f\ e\fìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüìòü\fF\9c\fF\9c\fF\9c\fF\9c¤¶Üüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\fF\9c\fF\9c¼Æäüþüüþüüþüüþüüþüüþü\fF\9c\fF\9c\14\fF\9c\94ªÔüþüüþüüþüüþüìòü\14\fF\9c\fF\9c\fF\9c$Z¬üþüüþüüþüüþüüþü¬®¬\ 4\ 2\ 4\ 4\ 2\ 4\^\üþüüþüüþüüþüüþüüþüüþüüþü,.,|~|üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü<j´\fF\9c\fF\9c\fF\9cT~¼üþüüþüüþüüþüüþüÔÚì\14\fF\9c\fF\9c\fF\9c\fF\9cd\8aÄüþüüþüüþüüþüüþü¼Æä\fF\9c\fF\9c\fF\9c\fF\9cÔÚìüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c\fF\9c¼Æäüþüüþüüþüüþüüþü|~|\ 4\ 2\ 4\ 4\ 2\ 4ÜÞÜüþüüþüüþüüþüüþüüþüüþüüþüÌÎÌìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\94ªÔ\fF\9c\fF\9c\fF\9c\fF\9cüþüüþüüþüüþüüþü\84\9eÌ\fF\9c\fF\9c\14\fF\9c\fF\9c$Z¬üþüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c$Z¬üþüüþüüþüüþüÄÎä\fF\9c\fF\9c\14\fF\9cDr´üþüüþüüþüüþüüþüüþüLNL\ 4\ 2\ 4LNLüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÔÚì\fF\9c\fF\9c\14\fF\9c´Âäüþüüþüüþüüþü4f¬\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cÔÚìüþüüþüüþüüþü$Z¬\fF\9c\fF\9c\fF\9ct\96ÄüþüüþüüþüüþüDr´\fF\9c\fF\9c\fF\9c\fF\9cÜæôüþüüþüüþüüþüüþüüþü<><\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü$Z¬\fF\9c\fF\9c\fF\9ct\96ÄüþüüþüüþüÜæô\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c\14\84\9eÌüþüüþüüþüÔÚì\fF\9c\fF\9c\fF\9c\fF\9c´Âäüþüüþüüþü¤¶Ü\fF\9c\fF\9c\fF\9c\fF\9cd\8aÄüþüüþüüþüüþüüþüüþüüþü<><\ 4\ 2\ 4ìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c$Z¬üþüüþüüþü¤¶Ü\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c4f¬üþüüþüüþü\94ªÔ\fF\9c\fF\9c\14\14N¤üþüüþüüþüìòü$Z¬\fF\9c\14\fF\9c\fF\9c\fF\9c<j´ÔÚìüþüüþüüþüüþüüþü<><\1c\1e\1cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü¼Æä\fF\9c\fF\9c\14\fF\9cÔÚìüþüüþüT~¼\fF\9c\fF\9c\14\84\9eÌ\fF\9c\fF\9c\fF\9c\fF\9cìòüüþüüþü<j´\fF\9c\fF\9c\fF\9cT~¼üþüüþüüþü\94ªÔ\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c¤¶Üüþüüþüüþüüþü<><<><üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\fF\9c\fF\9c\fF\9c\fF\9c\94ªÔüþüüþü\14\fF\9c\fF\9c\fF\9cÜæôT~¼\fF\9c\14\fF\9c¤¶Üüþüìòü\fF\9c\fF\9c\fF\9c\fF\9c¤¶Üüþüüþüüþü\84\9eÌ\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c¤¶Üüþüüþüüþü|~|<><üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüT~¼\fF\9c\fF\9c\fF\9cDr´üþü´Âä\fF\9c\fF\9c\fF\9c4f¬üþü\94ªÔ\fF\9c\fF\9c\fF\9cT~¼üþü¤¶Ü\fF\9c\fF\9c\fF\9c\fF\9cÜæôüþüüþüüþüÄÎä\84\9eÌ\84\9eÌ\84\9eÌ4f¬\14\fF\9c\fF\9c\14\fF\9c\14N¤ìòüüþüüþü\9c\9e\9c<><üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü¤¶Ü\fF\9c\14\fF\9c\fF\9cìòüt\96Ä\fF\9c\fF\9c\14N¤t\96ÄüþüÜæô\fF\9c\fF\9c\fF\9c\14N¤üþüd\8aÄ\fF\9c\14\fF\9c<j´üþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\14\fF\9c\fF\9c\fF\9c\fF\9c\84\9eÌüþüüþüÜÞÜ<><üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÜæô\fF\9c\fF\9c\fF\9c\fF\9c¤¶Ü$Z¬\fF\9c\fF\9c\fF\9cÔÚìüþüüþü$Z¬\fF\9c\fF\9c\fF\9cÄÎä\14\fF\9c\fF\9c\fF\9c\84\9eÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÔÚì\fF\9c\fF\9c\fF\9c\fF\9c\14N¤üþüüþüüþü|~|üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü4f¬\fF\9c\fF\9c\fF\9c<j´\fF\9c\fF\9c\fF\9c\14N¤üþüüþüüþüt\96Ä\14\fF\9c\fF\9c<j´\fF\9c\fF\9c\fF\9c\fF\9cÔÚìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüd\8aÄ\fF\9c\14\fF\9c\fF\9cÔÚìüþüüþü¼¾¼üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüt\96Ä\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cd\8aÄüþüüþüüþüÄÎä\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c$Z¬üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü´Âä\fF\9c\fF\9c\fF\9c\14\94ªÔüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÔÚì\fF\9c\fF\9c\14\fF\9c\fF\9c\14\fF\9c¼Æäüþüüþüüþüüþü\14\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9cd\8aÄüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÔÚì\fF\9c\fF\9c\fF\9c\fF\9c\84\9eÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cìòüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c¼Æäüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14\fF\9c\fF\9c\fF\9c\84\9eÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cT~¼üþüüþüüþüüþüüþü¤¶Ü\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9cìòüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÜæô\fF\9c\fF\9c\14\fF\9cl\8aļ¾¼üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü¼Æä\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\94ªÔüþüüþüüþüüþüüþüìòü\fF\9c\fF\9c\fF\9c\14\fF\9cT~¼üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\fF\9c\fF\9c\fF\9c\fF\9c\84\9eÌLNLüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü<><ÜÞÜüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüìòü\fF\9c\fF\9c\14\fF\9c\fF\9cÜæôüþüüþüüþüüþüüþüüþüDr´\fF\9c\fF\9c\fF\9c\fF\9c\94ªÔüþüüþüüþü¼ÆäT~¼4f¬üþüüþüüþüüþüüþüüþüüþüt\96Ä\fF\9c\14\fF\9c\fF\9cÄÎä\8c\8e\8c|~|üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\8c\8a\8c\ 4\ 2\ 4¬®¬üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüDr´\fF\9c\fF\9c\fF\9c<j´üþüüþüüþüüþüüþüüþüüþü\94ªÔ\fF\9c\fF\9c\fF\9c\fF\9cÜæôüþüüþü4f¬\fF\9c\fF\9c\fF\9c¼Æäüþüüþüüþüüþüüþüìòü$Z¬\fF\9c\fF\9c\fF\9c\fF\9cìòüÜÞÜ\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÌÎÌ\f\ e\f\ 4\ 2\ 4|~|üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\94ªÔ\fF\9c\fF\9c\fF\9ct\96ÄüþüüþüüþüüþüüþüüþüüþüÜæô\fF\9c\fF\9c\fF\9c<j´üþüüþüüþüd\8aÄ\fF\9c\fF\9c\fF\9c\14N¤ÔÚìüþüüþüüþüüþüt\96Ä\fF\9c\fF\9c\fF\9c\fF\9cT~¼üþüüþülnl\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþüüþüüþüÌÎÌ\f\ e\f\ 4\ 2\ 4\ 4\ 2\ 4\9c\9e\9cüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÜæô\fF\9c\fF\9c\14N¤ÄÎäüþüüþüüþüüþüüþüüþüüþüüþü$Z¬\14\fF\9ct\96ÄüþüüþüüþüÜæô\14\fF\9c\fF\9c\fF\9c\14\84\9eÌÄÎäÔÚìd\8aÄ\fF\9c\14\fF\9c\fF\9c\14N¤ÄÎäüþüüþüìîì\f\ e\f\ 4\ 2\ 4\8c\8a\8cüþüüþüüþüüþüüþüüþü\8c\8a\8c\f\ e\f\ 4\ 2\ 4\ 4\ 2\ 4,.,üþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü$Z¬\fF\9c\14N¤üþüüþüüþüüþüüþüüþüüþüüþüüþüt\96Ä\fF\9c\fF\9cÄÎäüþüüþüüþüüþü\84\9eÌ\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9cT~¼üþüüþüüþüüþü¬®¬\ 4\ 2\ 4\ 4\ 2\ 4\1c\1e\1clnl¬®¬¬®¬lnl\1c\1e\1c\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\f\ e\fÜÞÜüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüt\96Ä\fF\9cd\8aÄüþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\fF\9c\14N¤üþüüþüüþüüþüüþüüþüDr´\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\14\fF\9c\fF\9c\fF\9c\fF\9c4f¬ìòüüþüüþüüþüüþüüþü\9c\9e\9c\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\f\ e\fÌÎÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÄÎä\fF\9c¤¶Üüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14N¤d\8aÄüþüüþüüþüüþüüþüüþüìòül\8aÄ\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c\fF\9c<j´ìòüüþüüþüüþüüþüüþüüþüüþü\9c\9e\9c\f\ e\f\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\1c\1e\1cÌÎÌüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\14N¤ìòüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüd\8aĤ¶ÜüþüüþüüþüüþüüþüüþüüþüüþüÄÎäT~¼\fF\9c\14\fF\9c\fF\9c<j´¤¶ÜüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüÜÞÜlnl,.,\ 4\ 2\ 4\ 4\ 2\ 4<><\8c\8e\8cìîìüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþüüþü\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4\ 4\ 2\ 4
\ No newline at end of file
index 8200c65..7babde8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,3 +38,11 @@ int UtcDaliBmp24bpp(void)
 
   END_TEST;
 }
+int UtcDaliBmpRGB8(void)
+{
+  ImageDetails image(TEST_IMAGE_DIR "/w3c_home_256.bmp", 72u, 48u);
+
+  TestImageLoading(image, BmpLoaders);
+
+  END_TEST;
+}
\ No newline at end of file
index fe87cf9..80c455d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -147,9 +147,9 @@ bool DecodeRGB24V5(FILE*          fp,
     return false;
   }
 
-  for(unsigned int yPos = 0; yPos < height; yPos++)
+  for(std::uint32_t yPos = 0; yPos < height; ++yPos)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       pixelsPtr = pixels + (yPos * rowStride);
@@ -163,11 +163,11 @@ bool DecodeRGB24V5(FILE*          fp,
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
     }
-    for(unsigned int i = 0; i < rowStride; i += 3)
+    for(std::uint32_t i = 0; i < rowStride; i += 3)
     {
-      unsigned char temp = pixelsPtr[i];
-      pixelsPtr[i]       = pixelsPtr[i + 2];
-      pixelsPtr[i + 2]   = temp;
+      std::uint8_t temp = pixelsPtr[i];
+      pixelsPtr[i]      = pixelsPtr[i + 2];
+      pixelsPtr[i + 2]  = temp;
     }
 
     if(padding)
@@ -214,9 +214,9 @@ bool DecodeBF32V4(FILE*          fp,
     return false;
   }
 
-  for(unsigned int yPos = 0; yPos < height; yPos++)
+  for(std::uint32_t yPos = 0; yPos < height; ++yPos)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       pixelsPtr = pixels + (yPos * rowStride);
@@ -230,11 +230,11 @@ bool DecodeBF32V4(FILE*          fp,
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
     }
-    for(unsigned int i = 0; i < rowStride; i += 4)
+    for(std::uint32_t i = 0; i < rowStride; i += 4)
     {
-      unsigned char temp = pixelsPtr[i];
-      pixelsPtr[i]       = pixelsPtr[i + 2];
-      pixelsPtr[i + 2]   = temp;
+      std::uint8_t temp = pixelsPtr[i];
+      pixelsPtr[i]      = pixelsPtr[i + 2];
+      pixelsPtr[i + 2]  = temp;
     }
     if(padding)
     {
@@ -280,9 +280,9 @@ bool DecodeBF32(FILE*          fp,
     return false;
   }
 
-  for(unsigned int yPos = 0; yPos < height; yPos++)
+  for(std::uint32_t yPos = 0; yPos < height; ++yPos)
   {
-    unsigned char* pixelsPtr;
+    std::uint8_t* pixelsPtr;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -299,11 +299,11 @@ bool DecodeBF32(FILE*          fp,
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
     }
-    for(unsigned int i = 0; i < rowStride; i += 4)
+    for(std::uint32_t i = 0; i < rowStride; i += 4)
     {
-      unsigned char temp = pixelsPtr[i];
-      pixelsPtr[i]       = pixelsPtr[i + 2];
-      pixelsPtr[i + 2]   = temp;
+      std::uint8_t temp = pixelsPtr[i];
+      pixelsPtr[i]      = pixelsPtr[i + 2];
+      pixelsPtr[i + 2]  = temp;
     }
 
     if(padding)
@@ -346,12 +346,12 @@ bool DecodeBF565(FILE*          fp,
     return false;
   }
 
-  width                  = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  unsigned int rowStride = width * 2;
+  width                   = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
+  std::uint32_t rowStride = width * 2;
 
-  for(unsigned int i = 0; i < height; i++)
+  for(std::uint32_t i = 0; i < height; ++i)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -402,12 +402,12 @@ bool DecodeBF555(FILE*          fp,
 
   width = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
 
-  std::vector<char> raw(width * height * 2);
-  unsigned int      rawStride = width * 2;
-  unsigned int      rowStride = width * 3;
+  std::vector<std::uint8_t> raw(width * height * 2);
+  std::uint32_t             rawStride = width * 2;
+  std::uint32_t             rowStride = width * 3;
 
-  char* rawPtr = NULL;
-  for(unsigned int j = 0; j < height; j++)
+  std::uint8_t* rawPtr = NULL;
+  for(std::uint32_t j = 0; j < height; ++j)
   {
     rawPtr = &raw[0] + (j * rawStride);
     if(fread(rawPtr, 1, rawStride, fp) != rawStride)
@@ -416,9 +416,9 @@ bool DecodeBF555(FILE*          fp,
     }
   }
 
-  for(unsigned int yPos = 0; yPos < height; yPos++)
+  for(std::uint32_t yPos = 0; yPos < height; ++yPos)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -430,9 +430,9 @@ bool DecodeBF555(FILE*          fp,
       pixelsPtr = pixels + (((height - 1) - yPos) * rowStride);
     }
 
-    for(unsigned int k = 0; k < width; k++)
+    for(std::uint32_t k = 0; k < width; ++k)
     {
-      int index            = yPos * rawStride + 2 * k;
+      std::uint32_t index  = yPos * rawStride + 2 * k;
       pixelsPtr[3 * k]     = ((raw[index + 1] >> 2) & 0x1F) * 0xFF / 0x1F;
       pixelsPtr[3 * k + 1] = (((raw[index + 1] & 0x03) << 3) | (raw[index] >> 5)) * 0xFF / 0x1F;
       pixelsPtr[3 * k + 2] = (raw[index] & 0x1F) * 0xFF / 0x1F;
@@ -470,12 +470,12 @@ bool DecodeRGB555(FILE*          fp,
   }
 
   width = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  std::vector<char> raw(width * height * 2);
-  unsigned int      rawStride = width * 2;
-  unsigned int      rowStride = width * 3;
+  std::vector<std::uint8_t> raw(width * height * 2);
+  std::uint32_t             rawStride = width * 2;
+  std::uint32_t             rowStride = width * 3;
 
-  char* rawPtr = NULL;
-  for(unsigned int j = 0; j < height; j++)
+  std::uint8_t* rawPtr = NULL;
+  for(std::uint32_t j = 0; j < height; ++j)
   {
     rawPtr = &raw[0] + (j * rawStride);
     if(fread(rawPtr, 1, rawStride, fp) != rawStride)
@@ -483,9 +483,9 @@ bool DecodeRGB555(FILE*          fp,
       return false;
     }
   }
-  for(unsigned int i = 0; i < height; i++)
+  for(std::uint32_t i = 0; i < height; ++i)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -496,9 +496,9 @@ bool DecodeRGB555(FILE*          fp,
       // the data in the file is bottom up, and we store the data top down
       pixelsPtr = pixels + (((height - 1) - i) * rowStride);
     }
-    for(unsigned int k = 0; k < width; k++)
+    for(std::uint32_t k = 0; k < width; ++k)
     {
-      int index            = i * rawStride + 2 * k;
+      std::uint32_t index  = i * rawStride + 2 * k;
       pixelsPtr[3 * k]     = ((raw[index + 1] >> 2) & 0x1F) * 0xFF / 0x1F;
       pixelsPtr[3 * k + 1] = (((raw[index + 1] & 0x03) << 3) | (raw[index] >> 5)) * 0xFF / 0x1F;
       pixelsPtr[3 * k + 2] = (raw[index] & 0x1F) * 0xFF / 0x1F;
@@ -535,18 +535,18 @@ bool DecodeRGB1(FILE*          fp,
     return false;
   }
 
-  unsigned char     colorTable[8] = {0};
-  char              cmd;
-  unsigned int      fillw = ((width & 63) != 0) ? width + 64 - (width & 63) : width;
-  std::vector<char> colorIndex(fillw * height);
-  unsigned int      rowStride = fillw * 3; // RGB
+  std::uint8_t              colorTable[8] = {0};
+  std::uint8_t              cmd;
+  std::uint32_t             fillw = ((width & 63) != 0) ? width + 64 - (width & 63) : width;
+  std::vector<std::uint8_t> colorIndex(fillw * height);
+  std::uint32_t             rowStride = fillw * 3; // RGB
 
   if(fread(colorTable, 1, 8, fp) != 8)
   {
     return false;
   }
 
-  for(unsigned int i = 0; i < fillw * height; i += 8)
+  for(std::uint32_t i = 0; i < fillw * height; i += 8)
   {
     if(fread(&cmd, 1, 1, fp) != 1)
     {
@@ -563,9 +563,9 @@ bool DecodeRGB1(FILE*          fp,
     colorIndex[i + 7] = (cmd & 0x01);
   }
 
-  for(unsigned int index = 0; index < height; index = index + 1)
+  for(std::uint32_t index = 0; index < height; ++index)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -576,9 +576,9 @@ bool DecodeRGB1(FILE*          fp,
       // the data in the file is bottom up, and we store the data top down
       pixelsPtr = pixels + (((height - 1) - index) * rowStride);
     }
-    for(unsigned int j = 0; j < fillw; j++)
+    for(std::uint32_t j = 0; j < fillw; ++j)
     {
-      unsigned int ctIndex = 0;
+      std::uint32_t ctIndex = 0;
       if((fillw * index + j) < (fillw * height))
       {
         ctIndex = colorIndex[fillw * index + j];
@@ -627,18 +627,18 @@ bool DecodeRGB4(FILE*          fp,
     return false;
   }
 
-  char              colorTable[64];
-  char              cmd;
-  unsigned int      fillw = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  std::vector<char> colorIndex(fillw * height);
-  unsigned int      rowStride = fillw * 3;
+  std::uint8_t              colorTable[64];
+  std::uint8_t              cmd;
+  std::uint32_t             fillw = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
+  std::vector<std::uint8_t> colorIndex(fillw * height);
+  std::uint32_t             rowStride = fillw * 3;
 
   if(fread(colorTable, 1, 64, fp) != 64)
   {
     return false;
   }
 
-  for(unsigned int i = 0; i < fillw * height; i += 2)
+  for(std::uint32_t i = 0; i < fillw * height; i += 2)
   {
     if(fread(&cmd, 1, 1, fp) != 1)
     {
@@ -648,11 +648,11 @@ bool DecodeRGB4(FILE*          fp,
     colorIndex[i]     = cmd >> 4;
     colorIndex[i + 1] = cmd & (0x0F);
   }
-  unsigned int ctIndex = 0;
+  std::uint32_t ctIndex = 0;
 
-  for(unsigned int index = 0; index < height; index = index + 1)
+  for(std::uint32_t index = 0; index < height; ++index)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -663,7 +663,7 @@ bool DecodeRGB4(FILE*          fp,
       // the data in the file is bottom up, and we store the data top down
       pixelsPtr = pixels + (((height - 1) - index) * rowStride);
     }
-    for(unsigned int j = 0; j < fillw; j++)
+    for(std::uint32_t j = 0; j < fillw; ++j)
     {
       ctIndex                = colorIndex[fillw * index + j];
       pixelsPtr[3 * j]       = colorTable[4 * ctIndex + 2];
@@ -703,29 +703,23 @@ bool DecodeRGB8(FILE*          fp,
     return false;
   }
 
-  std::vector<char> colorTable(1024);
+  std::vector<std::uint8_t> colorTable(1024);
   width = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  char              cmd;
-  std::vector<char> colorIndex(width * height);
-  unsigned int      rowStride = width * 3; //RGB8->RGB24
+  std::vector<std::uint8_t> colorIndex(width * height);
+  std::uint32_t             rowStride = width * 3; //RGB8->RGB24
 
   if(fread(&colorTable[0], 1, 1024, fp) != 1024)
   {
     return false;
   }
-  for(unsigned int i = 0; i < width * height; i++)
+  if(fread(&colorIndex[0], 1, width * height, fp) != width * height)
   {
-    if(fread(&cmd, 1, 1, fp) != 1)
-    {
-      return false;
-    }
-
-    colorIndex[i] = cmd;
+    return false;
   }
-  unsigned int ctIndex = 0;
-  for(unsigned int index = 0; index < height; index = index + 1)
+  std::uint8_t ctIndex = 0;
+  for(std::uint32_t index = 0; index < height; ++index)
   {
-    unsigned char* pixelsPtr = NULL;
+    std::uint8_t* pixelsPtr = NULL;
     if(topDown)
     {
       // the data in the file is top down, and we store the data top down
@@ -736,7 +730,7 @@ bool DecodeRGB8(FILE*          fp,
       // the data in the file is bottom up, and we store the data top down
       pixelsPtr = pixels + (((height - 1) - index) * rowStride);
     }
-    for(unsigned int j = 0; j < width; j++)
+    for(std::uint8_t j = 0; j < width; ++j)
     {
       ctIndex                = colorIndex[width * index + j];
       pixelsPtr[3 * j]       = colorTable[4 * ctIndex + 2];
@@ -769,17 +763,17 @@ bool DecodeRLE4(FILE*          fp,
     DALI_LOG_ERROR("Error decoding BMP_RLE4 format\n");
     return false;
   }
-  unsigned char* pixelsPtr = pixels;
-  width                    = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  char              cmd[2];
-  unsigned int      cmdStride = 2;
-  char              colorTable[64];
-  std::vector<char> colorIndex(width * height >> 1);
-  std::vector<char> run;
-  unsigned int      x  = 0;
-  unsigned int      y  = 0;
-  unsigned int      dx = 0;
-  unsigned int      dy = 0;
+  std::uint8_t* pixelsPtr = pixels;
+  width                   = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
+  std::uint8_t              cmd[2];
+  std::uint32_t             cmdStride = 2;
+  std::uint8_t              colorTable[64];
+  std::vector<std::uint8_t> colorIndex(width * height >> 1);
+  std::vector<std::uint8_t> run;
+  std::uint32_t             x  = 0;
+  std::uint32_t             y  = 0;
+  std::uint32_t             dx = 0;
+  std::uint32_t             dy = 0;
   width += (width & 1);
   width = width >> 1;
 
@@ -830,9 +824,9 @@ bool DecodeRLE4(FILE*          fp,
           break;
         default:
           // decode a literal run
-          unsigned int length = cmd[1] & (0xFF);
+          std::uint32_t length = cmd[1] & (0xFF);
           //size of run, which is word aligned
-          unsigned int bytesize = length;
+          std::uint32_t bytesize = length;
           bytesize += (bytesize & 1);
           bytesize >>= 1;
           bytesize += (bytesize & 1);
@@ -846,14 +840,14 @@ bool DecodeRLE4(FILE*          fp,
           {
             length += (length & 1);
             length >>= 1;
-            for(unsigned int i = 0; i < length; i += 1)
+            for(std::uint32_t i = 0; i < length; ++i)
             {
               colorIndex[(x >> 1) + width * (height - y - 1) + i] = run[i];
             }
           }
           else
           {
-            for(unsigned int i = 0; i < length; i++)
+            for(std::uint32_t i = 0; i < length; ++i)
             {
               if((i & 1) == 0) //copy high to low
               {
@@ -871,19 +865,19 @@ bool DecodeRLE4(FILE*          fp,
     }
     else
     {
-      unsigned int length = cmd[0] & (0xFF);
+      std::uint32_t length = cmd[0] & (0xFF);
       if((x & 1) == 0)
       {
         length += (length & 1);
         length >>= 1;
-        for(unsigned int i = 0; i < length; i++)
+        for(std::uint32_t i = 0; i < length; ++i)
         {
           colorIndex[(height - y - 1) * width + i + (x >> 1)] = cmd[1];
         }
       }
       else
       {
-        for(unsigned int i = 0; i < length; i++)
+        for(std::uint32_t i = 0; i < length; ++i)
         {
           if((i & 1) == 0)
           {
@@ -899,9 +893,9 @@ bool DecodeRLE4(FILE*          fp,
     }
   }
 
-  int ctIndexHigh = 0;
-  int ctIndexLow  = 0;
-  for(unsigned int index = 0; index < (width * height); index = index + 1)
+  std::uint32_t ctIndexHigh = 0;
+  std::uint32_t ctIndexLow  = 0;
+  for(std::uint32_t index = 0; index < (width * height); ++index)
   {
     ctIndexHigh              = colorIndex[index] >> 4;
     ctIndexLow               = colorIndex[index] & (0x0F);
@@ -937,15 +931,15 @@ bool DecodeRLE8(FILE*          fp,
     DALI_LOG_ERROR("Error decoding BMP_RLE8 format\n");
     return false;
   }
-  unsigned char* pixelsPtr = pixels;
-  unsigned int   x         = 0;
-  unsigned int   y         = 0;
-  unsigned int   cmdStride = 2;
+  std::uint8_t* pixelsPtr = pixels;
+  std::uint32_t x         = 0;
+  std::uint32_t y         = 0;
+  std::uint32_t cmdStride = 2;
 
   width = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
-  std::vector<char> colorTable(1024);
-  char              cmd[2];
-  std::vector<char> colorIndex(width * height);
+  std::vector<std::uint8_t> colorTable(1024);
+  std::uint8_t              cmd[2];
+  std::vector<std::uint8_t> colorIndex(width * height);
 
   if(fseek(fp, offset, SEEK_SET))
   {
@@ -958,12 +952,12 @@ bool DecodeRLE8(FILE*          fp,
     return false;
   }
 
-  unsigned int      dx         = 0;
-  unsigned int      dy         = 0;
-  bool              finish     = false;
-  unsigned int      length     = 0;
-  unsigned int      copylength = 0;
-  std::vector<char> run;
+  std::uint32_t             dx         = 0;
+  std::uint32_t             dy         = 0;
+  bool                      finish     = false;
+  std::uint32_t             length     = 0;
+  std::uint32_t             copylength = 0;
+  std::vector<std::uint8_t> run;
   while((x + y * width) < width * height)
   {
     if(finish)
@@ -1010,7 +1004,7 @@ bool DecodeRLE8(FILE*          fp,
             return false;
           }
 
-          for(unsigned int i = 0; i < length; i += 1)
+          for(std::uint32_t i = 0; i < length; ++i)
           {
             colorIndex[x + width * (height - y - 1) + i] = run[i];
           }
@@ -1021,15 +1015,15 @@ bool DecodeRLE8(FILE*          fp,
     else
     {
       length = cmd[0] & (0xFF);
-      for(unsigned int i = 0; i < length; i++)
+      for(std::uint32_t i = 0; i < length; ++i)
       {
         colorIndex[(height - y - 1) * width + x] = cmd[1];
         x++;
       }
     }
   }
-  int ctIndex = 0;
-  for(unsigned int index = 0; index < width * height; index = index + 1)
+  std::uint32_t ctIndex = 0;
+  for(std::uint32_t index = 0; index < width * height; ++index)
   {
     ctIndex                  = colorIndex[index];
     pixelsPtr[3 * index]     = colorTable[4 * ctIndex + 2];