Re: [Qemu-devel] [PATCH] vnc-enc-tight: fix off-by-one bug

2016-07-15 Thread Gerd Hoffmann
On Di, 2016-07-12 at 17:31 +0800, Herongguang (Stephen) wrote: > 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

[Qemu-devel] [PATCH] vnc-enc-tight: fix off-by-one bug

2016-07-12 Thread Herongguang (Stephen)
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. Sign