Commit b8a00a1f authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/assenc: Use size_t for length of string

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent fe08058f
......@@ -45,7 +45,7 @@ static int ass_encode_frame(AVCodecContext *avctx,
unsigned char *buf, int bufsize,
const AVSubtitle *sub)
{
int len;
size_t len;
if (sub->num_rects != 1) {
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);
if (len > bufsize - 1) {
if (len >= bufsize) {
av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
return AVERROR_BUFFER_TOO_SMALL;
}
......
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