Skip to content

Commit abbc484

Browse files
uklotzdeSerial-ATA
authored andcommitted
wav: Fix division by zero for empty stream
1 parent a4bf4f3 commit abbc484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/iff/wav/properties.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub(super) fn read_properties(
180180
audio_bitrate,
181181
)
182182
}
183-
} else if bytes_per_second > 0 {
183+
} else if stream_len > 0 && bytes_per_second > 0 {
184184
let length = (u64::from(stream_len) * 1000) / u64::from(bytes_per_second);
185185

186186
let overall_bitrate = ((file_length * 8) / length) as u32;

0 commit comments

Comments
 (0)