summaryrefslogtreecommitdiffstats
path: root/hw/usb
diff options
context:
space:
mode:
authorPeter Maydell2019-01-10 19:45:23 +0100
committerPeter Maydell2019-01-10 19:45:23 +0100
commit291741033f611a4f0bbce3f7c9dead84ce315f96 (patch)
treea18e38d6663926b2f042a80b3f7b4c63d1c0c926 /hw/usb
parentMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.0-pull-re... (diff)
parentusb-audio: ignore usb packages with wrong size (diff)
downloadqemu-291741033f611a4f0bbce3f7c9dead84ce315f96.tar.gz
qemu-291741033f611a4f0bbce3f7c9dead84ce315f96.tar.xz
qemu-291741033f611a4f0bbce3f7c9dead84ce315f96.zip
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190110-pull-request' into staging
audio: two fixes. # gpg: Signature made Thu 10 Jan 2019 09:23:24 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/audio-20190110-pull-request: usb-audio: ignore usb packages with wrong size hw/audio/marvell: Don't include unnecessary i2c.h header file Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/dev-audio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index ee43e4914d..28ac7c5165 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -321,6 +321,9 @@ static int streambuf_put(struct streambuf *buf, USBPacket *p)
if (!free) {
return 0;
}
+ if (p->iov.size != USBAUDIO_PACKET_SIZE) {
+ return 0;
+ }
assert(free >= USBAUDIO_PACKET_SIZE);
usb_packet_copy(p, buf->data + (buf->prod % buf->size),
USBAUDIO_PACKET_SIZE);