* [Qemu-devel] [PATCH] wm8750: add record buffer underrun check
@ 2017-09-01 13:14 Gerd Hoffmann
2017-09-04 18:37 ` P J P
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2017-09-01 13:14 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Reported-by: niuguoxiang@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/audio/wm8750.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
index f8b5bebfc2..d2bf2e1da1 100644
--- a/hw/audio/wm8750.c
+++ b/hw/audio/wm8750.c
@@ -680,8 +680,12 @@ uint32_t wm8750_adc_dat(void *opaque)
WM8750State *s = (WM8750State *) opaque;
uint32_t *data;
- if (s->idx_in >= sizeof(s->data_in))
+ if (s->idx_in >= sizeof(s->data_in)) {
wm8750_in_load(s);
+ if (s->idx_in >= sizeof(s->data_in)) {
+ return 0x80008000; /* silence in AUD_FMT_S16 sample format */
+ }
+ }
data = (uint32_t *) &s->data_in[s->idx_in];
s->req_in -= 4;
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] wm8750: add record buffer underrun check
2017-09-01 13:14 [Qemu-devel] [PATCH] wm8750: add record buffer underrun check Gerd Hoffmann
@ 2017-09-04 18:37 ` P J P
0 siblings, 0 replies; 2+ messages in thread
From: P J P @ 2017-09-04 18:37 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
+-- On Fri, 1 Sep 2017, Gerd Hoffmann wrote --+
| diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
| index f8b5bebfc2..d2bf2e1da1 100644
| --- a/hw/audio/wm8750.c
| +++ b/hw/audio/wm8750.c
| @@ -680,8 +680,12 @@ uint32_t wm8750_adc_dat(void *opaque)
| WM8750State *s = (WM8750State *) opaque;
| uint32_t *data;
|
| - if (s->idx_in >= sizeof(s->data_in))
| + if (s->idx_in >= sizeof(s->data_in)) {
| wm8750_in_load(s);
| + if (s->idx_in >= sizeof(s->data_in)) {
| + return 0x80008000; /* silence in AUD_FMT_S16 sample format */
| + }
| + }
|
| data = (uint32_t *) &s->data_in[s->idx_in];
| s->req_in -= 4;
Ack, looks good. Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-04 18:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01 13:14 [Qemu-devel] [PATCH] wm8750: add record buffer underrun check Gerd Hoffmann
2017-09-04 18:37 ` P J P
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).