Fix decode_bmp crash by adding length check before reading the data in buffer (#14967)
* Fix decode_bmp crash by adding length check before reading the data in buffer This fix tries to address the issue raised in 14959 where the bmp content length was not checked before reading the buffer. As a result, decode_bmp might trigger a crash if the content of bmp is incomplete. This fix fixes the issue by adding the needed check before reading the data. This fix fixes 14959. Signed-off-by:Yong Tang <yong.tang.github@outlook.com> * Sanitize decode_bmp_op.cc with clang-format -i --style=Google Signed-off-by:
Yong Tang <yong.tang.github@outlook.com> * Add additional check to make sure header is safe to access in bmp Signed-off-by:
Yong Tang <yong.tang.github@outlook.com> * Not require padding (as paddings are not accessed) Signed-off-by:
Yong Tang <yong.tang.github@outlook.com> * Remove duplicated row_size calculation. Signed-off-by:
Yong Tang <yong.tang.github@outlook.com> * Add test cases for decoding incomplete bmp Signed-off-by:
Yong Tang <yong.tang.github@outlook.com>
Loading
Please sign in to comment