diff mbox

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

Message ID 20170608215356.23864-2-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer June 8, 2017, 9:53 p.m. UTC
This makes the code easier to understand and allows future changes simplifying some of the
scanf() away

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

Patch

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;