mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-13 09:03:10 +01:00
Avoid division by zero
This commit is contained in:
parent
e60d5351a5
commit
3479e1ccfc
1 changed files with 4 additions and 1 deletions
|
@ -1990,7 +1990,10 @@ func (portal *Portal) convertMediaMessageContent(intent *appservice.IntentAPI, m
|
|||
max = waveform[i]
|
||||
}
|
||||
}
|
||||
multiplier := 1024 / max
|
||||
multiplier := 0
|
||||
if max > 0 {
|
||||
multiplier = 1024 / max
|
||||
}
|
||||
if multiplier > 32 {
|
||||
multiplier = 32
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue