mirror of https://git.ffmpeg.org/ffmpeg.git
libavutil/base64: Try not to write over the array end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d216566f2
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
98c7f5a2fc
commit
7ed79fe736
|
@ -120,10 +120,12 @@ int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
out3:
|
out3:
|
||||||
*dst++ = v >> 10;
|
if (end - dst)
|
||||||
|
*dst++ = v >> 10;
|
||||||
v <<= 2;
|
v <<= 2;
|
||||||
out2:
|
out2:
|
||||||
*dst++ = v >> 4;
|
if (end - dst)
|
||||||
|
*dst++ = v >> 4;
|
||||||
out1:
|
out1:
|
||||||
out0:
|
out0:
|
||||||
return bits & 1 ? AVERROR_INVALIDDATA : dst - out;
|
return bits & 1 ? AVERROR_INVALIDDATA : dst - out;
|
||||||
|
|
Loading…
Reference in New Issue