wm8750: add record buffer underrun check
Reported-by: niuguoxiang@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170901131409.6712-1-kraxel@redhat.com
This commit is contained in:
parent
f75637badd
commit
4bb3893908
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user