hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
PATCH 1/1 hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
Coverity points out that calculating src_len by multiplying src_width by rows could overflow. This can only happen in the implausible case of a framebuffer larger than 4GB, but we may as well fix it, placating Coverity. (CID1005515)
Signed-off-by Peter Maydell <[email protected]>
--- hw/display/framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/framebuffer.c +1 -1
@@ -78,7 +78,7 @@ void framebuffer_update_display( i = *first_row; *first_row =-1 ; - src_len = src_width * rows; + src_len = (hwaddr )src_width * rows; mem = mem_section->mr;if (!mem) {
Signature · 1 line
2.7.4
Michael Tokarev
AppliedQuoted 4 lines · Peter Maydell
Coverity points out that calculating
src_lenby multiplyingsrc_widthby rows could overflow. This can only happen in the implausible case of a framebuffer larger than 4GB, but we may as well fix it, placating Coverity. (CID1005515)
Applied to -trivial, thanks!
/mjt