Commit 26bef5d2 authored by Max Kellermann's avatar Max Kellermann

DecoderAPI: use std::min()

parent cd6e0ff8
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment