# HG changeset patch # User reimar # Date 1252943045 0 # Node ID 36225b62e09196dc4d260a6512e0c5fbcf6efd6d # Parent 1dbe578de8e6fbb637e42c92b941b72fc4dc912a Check buffer size for idcin check, otherwise false positives are too likely for small probe buffer sizes due to 0-padding (see probetest results). diff -r 1dbe578de8e6 -r 36225b62e091 idcin.c --- a/idcin.c Sun Sep 13 20:08:47 2009 +0000 +++ b/idcin.c Mon Sep 14 15:44:05 2009 +0000 @@ -105,6 +105,11 @@ * 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))