[FFmpeg-cvslog] avformat/jacosubdec: make probing less tolerant.

Clément Bœsch git at videolan.org
Tue Nov 19 12:55:27 CET 2013


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Tue Nov 19 12:53:14 2013 +0100| [722fb81dc5c8546eb6498629db7c8ebe2f9545c2] | committer: Clément Bœsch

avformat/jacosubdec: make probing less tolerant.

Fixes a failure with probetest:
  ./tools/probetest 8192 500000
  [...]
  Failure of jacosub probing code with score=51 type=1 p=CAB size=16

Random data was:
  00000000  40 37 40 30 93 01 48 e0 09 96 10 90 78 0f 0c 10 @7 at 0..H.....x...

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=722fb81dc5c8546eb6498629db7c8ebe2f9545c2
---

 libavformat/jacosubdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index e2cbaad..e77ab40 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -43,8 +43,9 @@ typedef struct {
 static int timed_line(const char *ptr)
 {
     char c;
+    int fs, fe;
     return (sscanf(ptr, "%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 ||
-            sscanf(ptr, "@%*u @%*u %c",                       &c) == 1);
+            (sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
 }
 
 static int jacosub_probe(AVProbeData *p)



More information about the ffmpeg-cvslog mailing list