input/{async,rewind}, decoder/dsdiff: use std::cmp_*() for safer integer comparisons

This commit is contained in:
Max Kellermann
2024-03-15 18:45:45 +01:00
parent cc291e8c98
commit e4ba736d03
3 changed files with 3 additions and 3 deletions

View File

@@ -387,7 +387,7 @@ dsdiff_decode_chunk(DecoderClient &client, InputStream &is,
/* see how much aligned data from the remaining chunk
fits into the local buffer */
size_t now_size = buffer_size;
if (remaining_bytes < (offset_type)now_size) {
if (std::cmp_less(remaining_bytes, now_size)) {
unsigned now_frames = remaining_bytes / frame_size;
now_size = now_frames * frame_size;
}