Re: [Spice-devel] [spice-common 3/8] lz: Don't try to print uninitialized variable

2019-03-28 Thread Frediano Ziglio
> 
> encoder->type is only going to be set by lz_set_sizes() after the
> error() call. We can use 'type' directly which is what encoder->type is
> going to be set to.
> 
> Signed-off-by: Christophe Fergeau 

Acked-by: Frediano Ziglio 

> ---
>  common/lz.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/lz.c b/common/lz.c
> index 167e118..f92c638 100644
> --- a/common/lz.c
> +++ b/common/lz.c
> @@ -616,7 +616,7 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr,
> unsigned int num_io_bytes,
>  
>  int type = decode_32(encoder);
>  if (type <= LZ_IMAGE_TYPE_INVALID || type > LZ_IMAGE_TYPE_A8) {
> -encoder->usr->error(encoder->usr, "invalid lz type %d\n",
> encoder->type);
> +encoder->usr->error(encoder->usr, "invalid lz type %d\n", type);
>  }
>  int width = decode_32(encoder);
>  int height = decode_32(encoder);
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Spice-devel] [spice-common 3/8] lz: Don't try to print uninitialized variable

2019-03-28 Thread Christophe Fergeau
encoder->type is only going to be set by lz_set_sizes() after the
error() call. We can use 'type' directly which is what encoder->type is
going to be set to.

Signed-off-by: Christophe Fergeau 
---
 common/lz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/lz.c b/common/lz.c
index 167e118..f92c638 100644
--- a/common/lz.c
+++ b/common/lz.c
@@ -616,7 +616,7 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, 
unsigned int num_io_bytes,
 
 int type = decode_32(encoder);
 if (type <= LZ_IMAGE_TYPE_INVALID || type > LZ_IMAGE_TYPE_A8) {
-encoder->usr->error(encoder->usr, "invalid lz type %d\n", 
encoder->type);
+encoder->usr->error(encoder->usr, "invalid lz type %d\n", type);
 }
 int width = decode_32(encoder);
 int height = decode_32(encoder);
-- 
2.21.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel