vnc-enc-tight: fix off-by-one bug
commit3f7e51bca3ef2d64c53b35ab9916c99e4a9e3c69
authorHerongguang (Stephen) <herongguang.he@huawei.com>
Tue, 12 Jul 2016 09:31:23 +0000 (12 17:31 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 15 Jul 2016 10:11:55 +0000 (15 12:11 +0200)
tree4dba985541676ba4f1bbe65fc195acbbd26209af
parent5a8be0f73d6f60ff08746377eb09ca459f39deab
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>
ui/vnc-enc-tight.c