libhb: fix utf8/srt sub line ending parsing
authorjstebbins <jstebbins.hb@gmail.com>
Mon, 15 Sep 2014 18:40:32 +0000 (18:40 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Mon, 15 Sep 2014 18:40:32 +0000 (18:40 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6408 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decsrtsub.c

index 5854138a38ece8ccc24f752fdd85e67dfa6e37d3..e0e0f2d2be54c8cc68ff208ffedbef2242e03901 100644 (file)
@@ -178,7 +178,17 @@ void hb_srt_to_ssa(hb_buffer_t *sub_in, int line)
             hb_buffer_realloc(sub_in, pos + 4);
             // After realloc, sub_in->data may change
             ssa = (char*)sub_in->data;
-            if (srt[ii] == '\n')
+            if (srt[ii] == '\r')
+            {
+                ssa[pos++] = '\\';
+                ssa[pos++] = 'N';
+                ii++;
+                if (srt[ii] == '\n')
+                {
+                    ii++;
+                }
+            }
+            else if (srt[ii] == '\n')
             {
                 ssa[pos++] = '\\';
                 ssa[pos++] = 'N';