[FFmpeg-devel] [PATCH 2/4] avcodec/samidec: use ff_htmlmarkup_to_ass()

Clément Bœsch u at pkh.me
Sun Aug 30 11:30:45 CEST 2015


On Fri, Aug 28, 2015 at 08:33:07PM -0700, Yayoi wrote:
[...]
> @@ -82,18 +89,18 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
>              if (*p == '<') {
>                  if (!av_strncasecmp(p, "<P", 2) && (p[2] == '>' || av_isspace(p[2])))
>                      break;
> -                if (!av_strncasecmp(p, "<BR", 3))
> +            }
> +            if (!av_strncasecmp(p, "<BR", 3)) {
>                      av_bprintf(dst, "\\N");
> -                p++;
> -                while (*p && *p != '>')
> -                    p++;
> -                if (!*p)
> -                    break;
> -                if (*p == '>')

> +                    p += 3;
> +                    while (*p && *p != '>')
> +                        p++;

*p can be 0 after this

>                      p++;

so when you execute this, shit happens. That's what I was trying to
explain in the previous patch.


> -                continue;
>              }
> -            if (!av_isspace(*p))

> +            if (*p == '\n') {
> +                av_bprintf(dst, "\\N");
> +            }

Is that really on purpose? <BR> is used to force a line break, but is a
real line break supposed to have the same purpose?

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150830/78033578/attachment.sig>


More information about the ffmpeg-devel mailing list