Commit 4bb38939 authored by Gerd Hoffmann's avatar Gerd Hoffmann

wm8750: add record buffer underrun check

Reported-by: niuguoxiang@huawei.com
Signed-off-by: 's avatarGerd Hoffmann <kraxel@redhat.com>
Message-id: 20170901131409.6712-1-kraxel@redhat.com
parent f75637ba
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment