Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -45,7 +45,7 @@ static int ass_encode_frame(AVCodecContext *avctx, · 44 unmodified lines | ||
| 45 | 45 | unsigned char *buf, int bufsize, |
| 46 | 46 | const AVSubtitle *sub) |
| 47 | 47 | { |
| 48 | − int len; | |
| 48 | + size_t len; | |
| 49 | 49 | |
| 50 | 50 | if (sub->num_rects != 1) { |
| 51 | 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 | 60 | len = av_strlcpy(buf, sub->rects[0]->ass, bufsize); |
| 61 | 61 | |
| 62 | − if (len > bufsize - 1) { | |
| 62 | + if (len >= bufsize) { | |
| 63 | 63 | av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n"); |
| 64 | 64 | return AVERROR_BUFFER_TOO_SMALL; |
| 65 | 65 | } |