[PATCH] ui/vnc: fix debug output for invalid audio message

Paolo Bonzini posted 1 patch 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230925145051.530834-1-pbonzini@redhat.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
ui/vnc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ui/vnc: fix debug output for invalid audio message
Posted by Paolo Bonzini 7 months, 1 week ago
The debug message was cut and pasted from the invalid audio format
case, but the audio message is at bytes 2-3.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 ui/vnc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 3d13757b72b..acb494d18a0 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2551,7 +2551,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
                     vs, vs->ioc, vs->as.fmt, vs->as.nchannels, vs->as.freq);
                 break;
             default:
-                VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 4));
+                VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 2));
                 vnc_client_error(vs);
                 break;
             }
-- 
2.41.0
Re: [PATCH] ui/vnc: fix debug output for invalid audio message
Posted by Daniel P. Berrangé 7 months, 1 week ago
On Mon, Sep 25, 2023 at 04:50:51PM +0200, Paolo Bonzini wrote:
> The debug message was cut and pasted from the invalid audio format
> case, but the audio message is at bytes 2-3.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  ui/vnc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 3d13757b72b..acb494d18a0 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -2551,7 +2551,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
>                      vs, vs->ioc, vs->as.fmt, vs->as.nchannels, vs->as.freq);
>                  break;
>              default:
> -                VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 4));
> +                VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 2));
>                  vnc_client_error(vs);
>                  break;
>              }

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|