From 81c2e13aa0a7559886502cfb69f788bd0de7a64a Mon Sep 17 00:00:00 2001
From: Umair Khan <omerjerk@gmail.com>
Date: Fri, 13 Jul 2018 13:24:51 +0530
Subject: [PATCH 1/1] avformat/lrcdec: fix losing opening bracket

---
 libavformat/lrcdec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c
index f4e9a4efa9..4093cbdf10 100644
--- a/libavformat/lrcdec.c
+++ b/libavformat/lrcdec.c
@@ -60,14 +60,15 @@ static int64_t count_ts(const char *p)
         } else if(p[offset] == '[') {
             offset++;
             in_brackets++;
-        } else if (p[offset] == ']' && in_brackets) {
-            offset++;
-            in_brackets--;
         } else if(in_brackets &&
                  (p[offset] == ':' || p[offset] == '.' || p[offset] == '-' ||
                  (p[offset] >= '0' && p[offset] <= '9'))) {
             offset++;
         } else {
+            if (p[offset] == ']' && in_brackets) {
+                offset++;
+                in_brackets--;
+            }
             break;
         }
     }
-- 
2.15.1

