[Spice-devel] [PATCH xf86-video-qxl] When uploading a region, do not go outside the source image size.
cfergeau at redhat.com
Tue Sep 23 08:53:32 PDT 2014
On Fri, Sep 19, 2014 at 01:52:35PM +0200, Christophe Fergeau wrote:
> On Fri, Sep 12, 2014 at 02:25:14PM -0500, Jeremy White wrote:
> > This problem was exposed (and probably only occurs) when using XSpice
> > in dfps mode with spice-html5, and resizing from larger to smaller.
> > The screen would be resized, but the update region would still attempt
> > to transmit any pending changes to the (now) truncated surface. This
> > would often lead to a crash.
> > Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> > ---
> > src/qxl_image.c | 2 ++
> > src/qxl_surface.c | 9 ++++++---
> > 2 files changed, 8 insertions(+), 3 deletions(-)
> > diff --git a/src/qxl_image.c b/src/qxl_image.c
> > index 8927fd4..53212de 100644
> > --- a/src/qxl_image.c
> > +++ b/src/qxl_image.c
> > @@ -62,6 +62,8 @@ hash_and_copy (const uint8_t *src, int src_stride,
> > const uint8_t *src_line = src + i * src_stride;
> > uint8_t *dest_line = dest + i * dest_stride;
> > int n_bytes = width * bytes_per_pixel;
> > + if (n_bytes > src_stride)
> > + n_bytes = src_stride;
> This file uses tabs. It seems there's a check to adjust the height in
> qxl_image_create() before calling into hash_and_copy?
I think I meant to ask whether this test and adjustment belonged in the
same place, but I kept the question to myself rather than writing it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: not available
More information about the Spice-devel