fix edge sample value (-1 and +1) overflow
This commit is contained in:
parent
5d3f082240
commit
f47736b7cb
|
@ -84,7 +84,7 @@ func Update() error {
|
||||||
if val > +1 {
|
if val > +1 {
|
||||||
val = +1
|
val = +1
|
||||||
}
|
}
|
||||||
valInt16 := int16(val * (1 << 15))
|
valInt16 := int16(val * (1<<15 - 1))
|
||||||
low := byte(valInt16 % (1 << 8))
|
low := byte(valInt16 % (1 << 8))
|
||||||
high := byte(valInt16 / (1 << 8))
|
high := byte(valInt16 / (1 << 8))
|
||||||
buf[i*4+c*2+0] = low
|
buf[i*4+c*2+0] = low
|
||||||
|
|
Loading…
Reference in New Issue