libavutil/base64: Try not to write over the array end

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0664cbd7
......@@ -127,10 +127,12 @@ validity_check:
}
out3:
*dst++ = v >> 10;
if (end - dst)
*dst++ = v >> 10;
v <<= 2;
out2:
*dst++ = v >> 4;
if (end - dst)
*dst++ = v >> 4;
out1:
out0:
return bits & 1 ? AVERROR_INVALIDDATA : out ? dst - out : 0;
......
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