Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Laszlo Ersek
On 02/10/16 16:29, Paolo Bonzini wrote: > > > On 10/02/2016 15:55, Laszlo Ersek wrote: Hmm, not sure why. We're comparing against the inclusive-exclusive range [0,s->vga.vram_size). The right way to check if something is within the range is >= min && < max; the right way to

Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Paolo Bonzini
On 10/02/2016 15:55, Laszlo Ersek wrote: >> > Hmm, not sure why. We're comparing against the inclusive-exclusive >> > range [0,s->vga.vram_size). The right way to check if something is >> > within the range is >= min && < max; the right way to check if something >> > is outside the range is <

Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Laszlo Ersek
On 02/10/16 13:32, Paolo Bonzini wrote: > > > On 09/02/2016 20:08, Laszlo Ersek wrote: >> On 02/09/16 11:59, Paolo Bonzini wrote: >>> The "max" value is being compared with >=, but addr + width points to >>> the first byte that will _not_ be copied. Subtract one like it is >>> already done

Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Paolo Bonzini
On 10/02/2016 16:54, Laszlo Ersek wrote: > On 02/10/16 16:29, Paolo Bonzini wrote: >> >> >> On 10/02/2016 15:55, Laszlo Ersek wrote: > Hmm, not sure why. We're comparing against the inclusive-exclusive > range [0,s->vga.vram_size). The right way to check if something is > within

Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-10 Thread Paolo Bonzini
On 09/02/2016 20:08, Laszlo Ersek wrote: > On 02/09/16 11:59, Paolo Bonzini wrote: >> The "max" value is being compared with >=, but addr + width points to >> the first byte that will _not_ be copied. Subtract one like it is >> already done above for the height. >> >> Cc: Gerd Hoffmann

[Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-09 Thread Paolo Bonzini
The "max" value is being compared with >=, but addr + width points to the first byte that will _not_ be copied. Subtract one like it is already done above for the height. Cc: Gerd Hoffmann Signed-off-by: Paolo Bonzini --- hw/display/cirrus_vga.c | 4

Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe

2016-02-09 Thread Laszlo Ersek
On 02/09/16 11:59, Paolo Bonzini wrote: > The "max" value is being compared with >=, but addr + width points to > the first byte that will _not_ be copied. Subtract one like it is > already done above for the height. > > Cc: Gerd Hoffmann > Signed-off-by: Paolo Bonzini