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))