avcodec/assenc: Use size_t for length of string

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-17 23:24:17 +01:00
parent fe08058f24
commit b8a00a1f73
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ static int ass_encode_frame(AVCodecContext *avctx,
unsigned char *buf, int bufsize, unsigned char *buf, int bufsize,
const AVSubtitle *sub) const AVSubtitle *sub)
{ {
int len; size_t len;
if (sub->num_rects != 1) { if (sub->num_rects != 1) {
av_log(avctx, AV_LOG_ERROR, "Only one rect per AVSubtitle is supported in ASS.\n"); av_log(avctx, AV_LOG_ERROR, "Only one rect per AVSubtitle is supported in ASS.\n");
@ -59,7 +59,7 @@ static int ass_encode_frame(AVCodecContext *avctx,
len = av_strlcpy(buf, sub->rects[0]->ass, bufsize); len = av_strlcpy(buf, sub->rects[0]->ass, bufsize);
if (len > bufsize - 1) { if (len >= bufsize) {
av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n"); av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
return AVERROR_BUFFER_TOO_SMALL; return AVERROR_BUFFER_TOO_SMALL;
} }