[FFmpeg-cvslog] avformat/img2dec: Fail probing when no data is yet available and the filename contains no number /glob patterns either.

Michael Niedermayer git at videolan.org
Fri Sep 12 19:02:50 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 11 16:48:03 2014 +0200| [b3fd2b175c90b4766034095e74e1f5112b1547ef] | committer: Michael Niedermayer

avformat/img2dec: Fail probing when no data is yet available and the filename contains no number/glob patterns either.

Fixes Ticket3901

the seek test error codes change due to a change in the failure path,
this could be avoided by changing the respective error codes to EINVAL

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/img2dec.c       |    2 ++
 tests/ref/seek/lavf-pbmpipe |   52 +++++++++++++++++++++----------------------
 tests/ref/seek/lavf-pgmpipe |   52 +++++++++++++++++++++----------------------
 tests/ref/seek/lavf-ppmpipe |   52 +++++++++++++++++++++----------------------
 4 files changed, 80 insertions(+), 78 deletions(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 9f48c5d..a21429f 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -162,6 +162,8 @@ static int img_read_probe(AVProbeData *p)
             return AVPROBE_SCORE_MAX;
         else if (is_glob(p->filename))
             return AVPROBE_SCORE_MAX;
+        else if (p->buf_size == 0)
+            return 0;
         else if (av_match_ext(p->filename, "raw") || av_match_ext(p->filename, "gif"))
             return 5;
         else
diff --git a/tests/ref/seek/lavf-pbmpipe b/tests/ref/seek/lavf-pbmpipe
index 2858934..25bb68f 100644
--- a/tests/ref/seek/lavf-pbmpipe
+++ b/tests/ref/seek/lavf-pbmpipe
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:317075
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
+ret:-1         st:-1 flags:0  ts:-1.000000
+ret:-1         st:-1 flags:1  ts: 1.894167
+ret:-1         st: 0 flags:0  ts: 0.800000
+ret:-1         st: 0 flags:1  ts:-0.320000
+ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-1         st:-1 flags:1  ts: 1.470835
+ret:-1         st: 0 flags:0  ts: 0.360000
+ret:-1         st: 0 flags:1  ts:-0.760000
+ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-1         st:-1 flags:1  ts: 1.047503
+ret:-1         st: 0 flags:0  ts:-0.040000
+ret:-1         st: 0 flags:1  ts: 2.840000
+ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-1         st:-1 flags:1  ts: 0.624171
+ret:-1         st: 0 flags:0  ts:-0.480000
+ret:-1         st: 0 flags:1  ts: 2.400000
+ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-1         st:-1 flags:1  ts: 0.200839
+ret:-1         st: 0 flags:0  ts:-0.920000
+ret:-1         st: 0 flags:1  ts: 2.000000
+ret:-1         st:-1 flags:0  ts: 0.883340
+ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-1         st: 0 flags:1  ts: 1.560000
+ret:-1         st:-1 flags:0  ts: 0.460008
+ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-pgmpipe b/tests/ref/seek/lavf-pgmpipe
index 8ba5180..57b4e4a 100644
--- a/tests/ref/seek/lavf-pgmpipe
+++ b/tests/ref/seek/lavf-pgmpipe
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:2534775
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
+ret:-1         st:-1 flags:0  ts:-1.000000
+ret:-1         st:-1 flags:1  ts: 1.894167
+ret:-1         st: 0 flags:0  ts: 0.800000
+ret:-1         st: 0 flags:1  ts:-0.320000
+ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-1         st:-1 flags:1  ts: 1.470835
+ret:-1         st: 0 flags:0  ts: 0.360000
+ret:-1         st: 0 flags:1  ts:-0.760000
+ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-1         st:-1 flags:1  ts: 1.047503
+ret:-1         st: 0 flags:0  ts:-0.040000
+ret:-1         st: 0 flags:1  ts: 2.840000
+ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-1         st:-1 flags:1  ts: 0.624171
+ret:-1         st: 0 flags:0  ts:-0.480000
+ret:-1         st: 0 flags:1  ts: 2.400000
+ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-1         st:-1 flags:1  ts: 0.200839
+ret:-1         st: 0 flags:0  ts:-0.920000
+ret:-1         st: 0 flags:1  ts: 2.000000
+ret:-1         st:-1 flags:0  ts: 0.883340
+ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-1         st: 0 flags:1  ts: 1.560000
+ret:-1         st:-1 flags:0  ts: 0.460008
+ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-ppmpipe b/tests/ref/seek/lavf-ppmpipe
index 46c535a..7087494 100644
--- a/tests/ref/seek/lavf-ppmpipe
+++ b/tests/ref/seek/lavf-ppmpipe
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:7603575
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
+ret:-1         st:-1 flags:0  ts:-1.000000
+ret:-1         st:-1 flags:1  ts: 1.894167
+ret:-1         st: 0 flags:0  ts: 0.800000
+ret:-1         st: 0 flags:1  ts:-0.320000
+ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-1         st:-1 flags:1  ts: 1.470835
+ret:-1         st: 0 flags:0  ts: 0.360000
+ret:-1         st: 0 flags:1  ts:-0.760000
+ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-1         st:-1 flags:1  ts: 1.047503
+ret:-1         st: 0 flags:0  ts:-0.040000
+ret:-1         st: 0 flags:1  ts: 2.840000
+ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-1         st:-1 flags:1  ts: 0.624171
+ret:-1         st: 0 flags:0  ts:-0.480000
+ret:-1         st: 0 flags:1  ts: 2.400000
+ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-1         st:-1 flags:1  ts: 0.200839
+ret:-1         st: 0 flags:0  ts:-0.920000
+ret:-1         st: 0 flags:1  ts: 2.000000
+ret:-1         st:-1 flags:0  ts: 0.883340
+ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-1         st: 0 flags:1  ts: 1.560000
+ret:-1         st:-1 flags:0  ts: 0.460008
+ret:-1         st:-1 flags:1  ts:-0.645825



More information about the ffmpeg-cvslog mailing list