diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 143b0aa12b..45c307f317 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -420,7 +420,7 @@ static int decode_frame(AVCodecContext *avctx, switch(buf[0]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - if (s->nb_args < MAX_NB_ARGS) + if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] < 6553) s->args[s->nb_args] = FFMAX(s->args[s->nb_args], 0) * 10 + buf[0] - '0'; break; case ';':