[FFmpeg-devel] [PATCH 1/2] libavutil/base64: Try not to write over the array end
Michael Niedermayer
michael at niedermayer.cc
Sat May 11 04:22:53 EEST 2024
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavutil/base64.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavutil/base64.c b/libavutil/base64.c
index 3e66f4fcbe5..69e11e6f5e1 100644
--- a/libavutil/base64.c
+++ b/libavutil/base64.c
@@ -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;
--
2.43.2
More information about the ffmpeg-devel
mailing list