StyleBox *tmp;
// last style != defaults, end the style entry and start a new one
- if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) ||
+ if (s->count + 1 > FFMIN(SIZE_MAX / sizeof(*s->style_attributes), UINT16_MAX) ||
!(tmp = av_fast_realloc(s->style_attributes,
&s->style_attributes_bytes_allocated,
(s->count + 1) * sizeof(*s->style_attributes)))) {
return AVERROR(EINVAL);
}
-#if FF_API_ASS_TIMING
- if (!strncmp(ass, "Dialogue: ", 10)) {
- int num;
- dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num);
- for (; dialog && num--; dialog++) {
- mov_text_dialog(s, dialog);
- ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text);
- }
- } else {
-#endif
- dialog = ff_ass_split_dialog2(s->ass_ctx, ass);
- if (!dialog)
- return AVERROR(ENOMEM);
- mov_text_dialog(s, dialog);
- ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text);
- ff_ass_free_dialog(&dialog);
-#if FF_API_ASS_TIMING
- }
-#endif
+ dialog = ff_ass_split_dialog2(s->ass_ctx, ass);
+ if (!dialog)
+ return AVERROR(ENOMEM);
+ mov_text_dialog(s, dialog);
+ ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text);
+ ff_ass_free_dialog(&dialog);
for (j = 0; j < box_count; j++) {
box_types[j].encode(s);
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_movtext_encoder = {
+const AVCodec ff_movtext_encoder = {
.name = "mov_text",
.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,