Commit 7c0d30b5 authored by Clément Bœsch's avatar Clément Bœsch

ass: use av_asprintf() instead of a temporary stack buffer.

parent 9729f140
...@@ -29,9 +29,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, ...@@ -29,9 +29,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
int bold, int italic, int underline, int bold, int italic, int underline,
int alignment) int alignment)
{ {
char header[512]; avctx->subtitle_header = av_asprintf(
snprintf(header, sizeof(header),
"[Script Info]\r\n" "[Script Info]\r\n"
"ScriptType: v4.00+\r\n" "ScriptType: v4.00+\r\n"
"\r\n" "\r\n"
...@@ -44,7 +42,6 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, ...@@ -44,7 +42,6 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
font, font_size, color, color, back_color, back_color, font, font_size, color, color, back_color, back_color,
-bold, -italic, -underline, alignment); -bold, -italic, -underline, alignment);
avctx->subtitle_header = av_strdup(header);
if (!avctx->subtitle_header) if (!avctx->subtitle_header)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
avctx->subtitle_header_size = strlen(avctx->subtitle_header); avctx->subtitle_header_size = strlen(avctx->subtitle_header);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment