[FFmpeg-devel] [PATCH 2/2] avcodec/htmlsubtitles: use next_closep instead of the identical value from sscanf()

Michael Niedermayer michael at niedermayer.cc
Fri Jun 9 00:53:56 EEST 2017


This makes the code easier to understand and allows future changes simplifying some of the
scanf() away

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/htmlsubtitles.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c
index ba4f269b3f..602fff9e2d 100644
--- a/libavcodec/htmlsubtitles.c
+++ b/libavcodec/htmlsubtitles.c
@@ -93,7 +93,7 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
 
             if (*next_closep == '}' && (an != 1 && (len = 0, sscanf(in, "{\\%*[^}]}%n", &len) >= 0 && len > 0)) ||
                 *next_closep == '}' && (len = 0, sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n", &len) >= 0 && len > 0)) {
-                in += len - 1;
+                in = next_closep;
             } else
                 av_bprint_chars(dst, *in, 1);
             break;
-- 
2.13.0



More information about the ffmpeg-devel mailing list