avcodec/movtextenc: Check for too long subtitles

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/375/head
Andreas Rheinhardt 3 years ago
parent 0b934f8f17
commit f8e5e1c523
  1. 2
      libavcodec/movtextenc.c

@ -667,6 +667,8 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
}
}
if (s->byte_count > UINT16_MAX)
return AVERROR(ERANGE);
AV_WB16(buf, s->byte_count);
buf += 2;

Loading…
Cancel
Save