DecoderAPI: use std::min()

This commit is contained in:
Max Kellermann 2014-08-31 08:27:51 +02:00
parent cd6e0ff88a
commit 26bef5d209

View File

@ -519,9 +519,7 @@ decoder_data(Decoder &decoder,
continue;
}
size_t nbytes = dest.size;
if (nbytes > length)
nbytes = length;
const size_t nbytes = std::min(dest.size, length);
/* copy the buffer */