VERA: fix possible PCM crash
This commit is contained in:
parent
dff445fa41
commit
a7be3e9514
2 changed files with 13 additions and 5 deletions
|
|
@ -70,10 +70,18 @@ void DivPlatformVERA::acquire(short** buf, size_t len) {
|
|||
if (!isMuted[16]) {
|
||||
// TODO stereo samples once DivSample has a support for it
|
||||
if (chan[16].pcm.depth16) {
|
||||
tmp_l=s->data16[chan[16].pcm.pos];
|
||||
if (chan[16].pcm.pos<s->samples) {
|
||||
tmp_l=s->data16[chan[16].pcm.pos];
|
||||
} else {
|
||||
tmp_l=0;
|
||||
}
|
||||
tmp_r=tmp_l;
|
||||
} else {
|
||||
tmp_l=s->data8[chan[16].pcm.pos];
|
||||
if (chan[16].pcm.pos<s->samples) {
|
||||
tmp_l=s->data8[chan[16].pcm.pos];
|
||||
} else {
|
||||
tmp_l=0;
|
||||
}
|
||||
tmp_r=tmp_l;
|
||||
}
|
||||
if (!(chan[16].pan&1)) tmp_l=0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue