summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fxcodec/lbmp/fx_bmp.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/fxcodec/lbmp/fx_bmp.cpp b/core/fxcodec/lbmp/fx_bmp.cpp
index fb64b36560..2b072a4a0c 100644
--- a/core/fxcodec/lbmp/fx_bmp.cpp
+++ b/core/fxcodec/lbmp/fx_bmp.cpp
@@ -358,6 +358,8 @@ int32_t bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) {
}
green_bits += blue_bits;
red_bits += green_bits;
+ if (blue_bits > 8 || green_bits < 8 || red_bits < 8)
+ return 2;
blue_bits = 8 - blue_bits;
green_bits -= 8;
red_bits -= 8;