diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-14 15:44:05 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-14 15:44:05 +0000 |
commit | 8466ab59b21257ff254b4c17ef428458bac645d9 (patch) | |
tree | cd3a893260cdf056553df354af17c59339971e08 /libavformat | |
parent | 03354862cbadbbd0ee6871c7c8b0d233415fc957 (diff) | |
download | ffmpeg-8466ab59b21257ff254b4c17ef428458bac645d9.tar.gz |
Check buffer size for idcin check, otherwise false positives are too likely for
small probe buffer sizes due to 0-padding (see probetest results).
Originally committed as revision 19838 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/idcin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 0a5f825df6..8e9dfb57c3 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -105,6 +105,11 @@ static int idcin_probe(AVProbeData *p) * audio channels: 0 for no audio, or 1 or 2 */ + /* check we have enough data to do all checks, otherwise the + 0-padding may cause a wrong recognition */ + if (p->buf_size < 20) + return 0; + /* check the video width */ number = AV_RL32(&p->buf[0]); if ((number == 0) || (number > 1024)) |