]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/audio/virtio-snd: fix invalid param check
authorVolker Rümelin <vr_qemu@t-online.de>
Fri, 2 Aug 2024 07:18:05 +0000 (09:18 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 30 Aug 2024 05:18:17 +0000 (08:18 +0300)
commit9943ceb460b4ba49cc56453cddb67405d94e39e0
tree346852d24f9c887fc22c20b1d7297a9da4fbceae
parent26654442113aa9183a5262503c39adc6fe6d69e8
hw/audio/virtio-snd: fix invalid param check

Commit 9b6083465f ("virtio-snd: check for invalid param shift
operands") tries to prevent invalid parameters specified by the
guest. However, the code is not correct.

Change the code so that the parameters format and rate, which are
a bit numbers, are compared with the bit size of the data type.

Fixes: 9b6083465f ("virtio-snd: check for invalid param shift operands")
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20240802071805.7123-1-vr_qemu@t-online.de>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 7d14471a121878602cb4e748c4707f9ab9a9e3e2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/audio/virtio-snd.c