ass_split_section: dont overread array
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 17:10:19 +0000 (18:10 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 17:10:35 +0000 (18:10 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ass_split.c

index 7ee48b4..4ef3092 100644 (file)
@@ -267,7 +267,8 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
                     }
             }
         }
-        buf += strcspn(buf, "\n") + 1;
+        buf += strcspn(buf, "\n");
+        buf += !!*buf;
     }
     return buf;
 }