History

avcodec/assenc: Use size_t for length of string

Andreas Rheinhardt committed 2 years ago

Commit b8a00a11 parent fe080581 file · +2 −2Browse files

Unified · Split

libavcodec/assenc.c+2−2
@@ -45,7 +45,7 @@ static int ass_encode_frame(AVCodecContext *avctx, · 44 unmodified lines
45 unsigned char *buf, int bufsize,45 unsigned char *buf, int bufsize,
46 const AVSubtitle *sub)46 const AVSubtitle *sub)
47{47{
48 int len;48 size_t len;
49 49
50 if (sub->num_rects != 1) {50 if (sub->num_rects != 1) {
51 av_log(avctx, AV_LOG_ERROR, "Only one rect per AVSubtitle is supported in ASS.\n");51 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, · 7 unmodified lines
59 59
60 len = av_strlcpy(buf, sub->rects[0]->ass, bufsize);60 len = av_strlcpy(buf, sub->rects[0]->ass, bufsize);
61 61
62 if (len > bufsize - 1) {62 if (len >= bufsize) {
63 av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");63 av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
64 return AVERROR_BUFFER_TOO_SMALL;64 return AVERROR_BUFFER_TOO_SMALL;
65 }65 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t