]> git.ipfire.org Git - thirdparty/qemu.git/commit
vnc-enc-tight: fix off-by-one bug
authorHerongguang (Stephen) <herongguang.he@huawei.com>
Tue, 12 Jul 2016 09:31:23 +0000 (17:31 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 28 Sep 2016 15:48:17 +0000 (10:48 -0500)
commit98b81297bfa7a1a7acfd8689f7c6447cbc128bfa
tree55657ab432f07bdde5fb16d6e6edd275717d25fd
parent8ef7abeccf527029c3b2e70ec585f1788fa2e007
vnc-enc-tight: fix off-by-one bug

In tight_encode_indexed_rect32, buf(or src)’s size is count. In for loop,
the logic is supposed to be that i is an index into src, i should be
incremented when incrementing src.

This is broken when src is incremented but i is not before while loop,
resulting in off-by-one bug in while loop.

Signed-off-by: He Rongguang <herongguang.he@huawei.com>
Message-id: 5784B8EB.7010008@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 3f7e51bca3ef2d64c53b35ab9916c99e4a9e3c69)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ui/vnc-enc-tight.c