[FFmpeg-devel] [PATCH 2/2] add ASS encoder and decoder

Aurelien Jacobs aurel
Sat Nov 27 02:09:20 CET 2010


On Sat, Nov 27, 2010 at 07:35:30AM +1000, Shawn King wrote:
> one more bug now that i got my patch working with the new version it
> seems like rect->ass isnt NULL('\0') terminated so it read past the
> end of the dialogue line the patch attached fixed it for me i dont
> know if you want to fix it that way or some other way

> --- libavcodec/ass.c.orig	2010-11-26 22:59:22.651702000 +1000
> +++ libavcodec/ass.c	2010-11-26 22:48:05.113702490 +1000
> @@ -60,7 +60,7 @@
>      sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration);
>      rects[sub->num_rects]       = av_mallocz(sizeof(*rects[0]));
>      rects[sub->num_rects]->type = SUBTITLE_ASS;
> -    rects[sub->num_rects]->ass  = av_malloc(len + dlen + 1);
> +    rects[sub->num_rects]->ass  = av_mallocz(len + dlen + 1);
>      strcpy (rects[sub->num_rects]->ass      , header);
>      strncpy(rects[sub->num_rects]->ass + len, dialog, dlen);
>      sub->num_rects++;

Thanks for the report. Fixed in a slightly different way.

Aurel



More information about the ffmpeg-devel mailing list