]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
allocate 32 extra bytes at the end of the probe buffer and remove most probe buf_size...
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 8 Apr 2007 11:34:15 +0000 (11:34 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 8 Apr 2007 11:34:15 +0000 (11:34 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8677 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

45 files changed:
libavformat/4xm.c
libavformat/aiff.c
libavformat/amr.c
libavformat/apc.c
libavformat/asf.c
libavformat/au.c
libavformat/avformat.h
libavformat/avidec.c
libavformat/avs.c
libavformat/bethsoftvid.c
libavformat/c93.c
libavformat/dsicin.c
libavformat/dxa.c
libavformat/electronicarts.c
libavformat/ffm.c
libavformat/flic.c
libavformat/flvdec.c
libavformat/gxf.c
libavformat/idcin.c
libavformat/idroq.c
libavformat/ipmovie.c
libavformat/libnut.c
libavformat/matroska.c
libavformat/mm.c
libavformat/mmf.c
libavformat/mov.c
libavformat/mp3.c
libavformat/mpc.c
libavformat/mpeg.c
libavformat/mtv.c
libavformat/nsvdec.c
libavformat/nuv.c
libavformat/ogg2.c
libavformat/raw.c
libavformat/rm.c
libavformat/segafilm.c
libavformat/sierravmd.c
libavformat/smacker.c
libavformat/sol.c
libavformat/swf.c
libavformat/thp.c
libavformat/tta.c
libavformat/utils.c
libavformat/vocdec.c
libavformat/yuv4mpeg.c

index bf10b9e820e344b2f93021d2dcd72cf13c3aa306..e3e3a9f799579725bb4b0ead94111cbbf570f3ba 100644 (file)
@@ -79,9 +79,6 @@ typedef struct FourxmDemuxContext {
 
 static int fourxm_probe(AVProbeData *p)
 {
-    if (p->buf_size < 12)
-        return 0;
-
     if ((AV_RL32(&p->buf[0]) != RIFF_TAG) ||
         (AV_RL32(&p->buf[8]) != _4XMV_TAG))
         return 0;
index 868d5521923ea5fbb0b96b2c224af94dc11c53f5..74ff14a14fa29c67f0cb96bd5e2fc639c3fa38c9 100644 (file)
@@ -275,8 +275,6 @@ static int aiff_write_trailer(AVFormatContext *s)
 static int aiff_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size < 16)
-        return 0;
     if (p->buf[0] == 'F' && p->buf[1] == 'O' &&
         p->buf[2] == 'R' && p->buf[3] == 'M' &&
         p->buf[8] == 'A' && p->buf[9] == 'I' &&
index 635a898fa7b7f64ccba4087dd7d1043be4878bd0..98fd35a08c8948e0d3a1faf1b8b2506caf4e2a8b 100644 (file)
@@ -73,8 +73,6 @@ static int amr_probe(AVProbeData *p)
     //This will also trigger multichannel files: "#!AMR_MC1.0\n" and
     //"#!AMR-WB_MC1.0\n" (not supported)
 
-    if (p->buf_size < 5)
-        return 0;
     if(memcmp(p->buf,AMR_header,5)==0)
         return AVPROBE_SCORE_MAX;
     else
index a937b1d8d714b16e391bd9eb0af124a21de89405..94ee28072ec8d88f58327edf37ed8d63066af7ac 100644 (file)
@@ -24,9 +24,6 @@
 
 static int apc_probe(AVProbeData *p)
 {
-    if (p->buf_size < 8)
-        return 0;
-
     if (!strncmp(p->buf, "CRYO_APC", 8))
         return AVPROBE_SCORE_MAX;
 
index 498f6e79ea2670d7b1eaa0bd56b74badcb3c25aa..5c67b7f25996b10f7f3467065d8d5763c9ed2b07 100644 (file)
@@ -119,9 +119,6 @@ static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size)
 static int asf_probe(AVProbeData *pd)
 {
     /* check file header */
-    if (pd->buf_size <= 32)
-        return 0;
-
     if (!memcmp(pd->buf, &asf_header, sizeof(GUID)))
         return AVPROBE_SCORE_MAX;
     else
index 9e84c9d313b201a2b30b5901ee5739cb920e7538..aaa97c76faa222acc504bd136792592b33cbdf07 100644 (file)
@@ -103,8 +103,6 @@ static int au_write_trailer(AVFormatContext *s)
 static int au_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 24)
-        return 0;
     if (p->buf[0] == '.' && p->buf[1] == 's' &&
         p->buf[2] == 'n' && p->buf[3] == 'd')
         return AVPROBE_SCORE_MAX;
index 1d811f324f4a00fcd35cc16338d5a76acd74d6f3..c5d5df01979a92b2cf056ad521f0995acb5a3c4e 100644 (file)
@@ -25,8 +25,8 @@
 extern "C" {
 #endif
 
-#define LIBAVFORMAT_VERSION_INT ((51<<16)+(11<<8)+0)
-#define LIBAVFORMAT_VERSION     51.11.0
+#define LIBAVFORMAT_VERSION_INT ((51<<16)+(12<<8)+0)
+#define LIBAVFORMAT_VERSION     51.12.0
 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
 
 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
@@ -132,6 +132,7 @@ typedef struct AVProbeData {
 } AVProbeData;
 
 #define AVPROBE_SCORE_MAX 100               ///< max score, half of that is used for file extension based detection
+#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
 
 typedef struct AVFormatParameters {
     AVRational time_base;
index 23c130ab7e6b7009fddb78f1c0d920d14e4aed79..02078bc77b75cb2110a9329effe7b357199acffc 100644 (file)
@@ -995,8 +995,6 @@ static int avi_read_close(AVFormatContext *s)
 static int avi_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
     if (p->buf[0] == 'R' && p->buf[1] == 'I' &&
         p->buf[2] == 'F' && p->buf[3] == 'F' &&
         p->buf[8] == 'A' && p->buf[9] == 'V' &&
index 0fa77defffc30acf8bc2f1a7333f1a33ef22b25a..5325ff6610895540b2930d993eb4b9ab75496b4e 100644 (file)
@@ -47,8 +47,6 @@ static int avs_probe(AVProbeData * p)
 {
     const uint8_t *d;
 
-    if (p->buf_size < 2)
-        return 0;
     d = p->buf;
     if (d[0] == 'w' && d[1] == 'W' && d[2] == 0x10 && d[3] == 0)
         return 50;
index 91fecb58412913ca9844f5f8067ee7074cf5d594..0e73804f438104a7762e9f8b0a9bbcb1c4d6223a 100644 (file)
@@ -49,7 +49,7 @@ typedef struct BVID_DemuxContext
 static int vid_probe(AVProbeData *p)
 {
     // little endian VID tag, file starts with "VID\0"
-    if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))
+    if (AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))
         return 0;
 
     return AVPROBE_SCORE_MAX;
index 89838d5398549381ef9d63825e4e6b401a22292d..636f3e0de7a739a75a28461d81ec1573d71350ed 100644 (file)
@@ -44,9 +44,6 @@ typedef struct {
 
 static int probe(AVProbeData *p)
 {
-    if (p->buf_size < 13)
-        return 0;
-
     if (p->buf[0] == 0x01 && p->buf[1] == 0x00 &&
         p->buf[4] == 0x01 + p->buf[2] &&
         p->buf[8] == p->buf[4] + p->buf[6] &&
index fb9cb50dfe604847d66477ba4b72ec3808581135..61e5e39a3a6d8ca2df0e529b12dc282574f637a8 100644 (file)
@@ -58,9 +58,6 @@ typedef struct CinDemuxContext {
 
 static int cin_probe(AVProbeData *p)
 {
-    if (p->buf_size < 18)
-        return 0;
-
     /* header starts with this special marker */
     if (AV_RL32(&p->buf[0]) != 0x55AA0000)
         return 0;
index f49d3d4acfb79c818670da7daff8196def11518a..81dbd2e713cb887526f131214631d2e9273fe91f 100644 (file)
@@ -36,8 +36,6 @@ typedef struct{
 static int dxa_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 4)
-        return 0;
     if (p->buf[0] == 'D' && p->buf[1] == 'E' &&
         p->buf[2] == 'X' && p->buf[3] == 'A')
         return AVPROBE_SCORE_MAX;
index 762d658ab1ec8122f6a6880f907c37682146f641..e140d494bbb996ef0bd67fb53abb2d58f65662a1 100644 (file)
@@ -165,9 +165,6 @@ static int process_ea_header(AVFormatContext *s) {
 
 static int ea_probe(AVProbeData *p)
 {
-    if (p->buf_size < 4)
-        return 0;
-
     if (AV_RL32(&p->buf[0]) != SCHl_TAG)
         return 0;
 
index a2970ae423cdc79d14e39e3048eff9f789d450b2..22cdaf3091f8e2138d122f4a845afade648934e7 100644 (file)
@@ -758,7 +758,7 @@ static int ffm_read_close(AVFormatContext *s)
 
 static int ffm_probe(AVProbeData *p)
 {
-    if (p->buf_size >= 4 &&
+    if (
         p->buf[0] == 'F' && p->buf[1] == 'F' && p->buf[2] == 'M' &&
         p->buf[3] == '1')
         return AVPROBE_SCORE_MAX + 1;
index 0c3a7f01f96fd1b6453ca096494f47868a69bc78..d5544b5e0ad7b73ed088b923a4ba7dbb68b40314 100644 (file)
@@ -55,9 +55,6 @@ static int flic_probe(AVProbeData *p)
 {
     int magic_number;
 
-    if (p->buf_size < 6)
-        return 0;
-
     magic_number = AV_RL16(&p->buf[4]);
     if ((magic_number != FLIC_FILE_MAGIC_1) &&
         (magic_number != FLIC_FILE_MAGIC_2) &&
index bf91fbbc78b4a22a4b666093bd3ccce32961c042..3278cdcff81b6c88a772f679a43debcf071ac3d6 100644 (file)
@@ -31,8 +31,6 @@ static int flv_probe(AVProbeData *p)
 {
     const uint8_t *d;
 
-    if (p->buf_size < 6)
-        return 0;
     d = p->buf;
     if (d[0] == 'F' && d[1] == 'L' && d[2] == 'V' && d[3] < 5 && d[5]==0) {
         return AVPROBE_SCORE_MAX;
index ba2463eadf472489e2f564cfdd57156df60c1679..a4a933c18481463690bdf48e91768f0bb6e4a2ed 100644 (file)
@@ -87,8 +87,6 @@ static int parse_packet_header(ByteIOContext *pb, pkt_type_t *type, int *length)
 static int gxf_probe(AVProbeData *p) {
     static const uint8_t startcode[] = {0, 0, 0, 0, 1, 0xbc}; // start with map packet
     static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2};
-    if (p->buf_size < 16)
-        return 0;
     if (!memcmp(p->buf, startcode, sizeof(startcode)) &&
         !memcmp(&p->buf[16 - sizeof(endcode)], endcode, sizeof(endcode)))
         return AVPROBE_SCORE_MAX;
index e2c92f3b450d54045bf1e4bccfb07abfa799ad33..f0f442700834e69b54da1aed6155982520100b55 100644 (file)
@@ -104,10 +104,6 @@ static int idcin_probe(AVProbeData *p)
      * audio channels: 0 for no audio, or 1 or 2
      */
 
-    /* cannot proceed without 20 bytes */
-    if (p->buf_size < 20)
-        return 0;
-
     /* check the video width */
     number = AV_RL32(&p->buf[0]);
     if ((number == 0) || (number > 1024))
index b8ee176ab9cbe851c7384176a0ca74aafe14cd3f..ddda86fec8d06ecdee1b8a8e35bc2a251650a84c 100644 (file)
@@ -58,9 +58,6 @@ typedef struct RoqDemuxContext {
 
 static int roq_probe(AVProbeData *p)
 {
-    if (p->buf_size < 6)
-        return 0;
-
     if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
         (AV_RL32(&p->buf[2]) != 0xFFFFFFFF))
         return 0;
index 975bfd36ba234bc4357b16c8824be165c13893a4..06585dfb6a3d371144569a1335769389498c96a7 100644 (file)
@@ -507,8 +507,6 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb,
 
 static int ipmovie_probe(AVProbeData *p)
 {
-    if (p->buf_size < IPMOVIE_SIGNATURE_SIZE)
-        return 0;
     if (strncmp(p->buf, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)
         return 0;
 
index 0f7b879a94d573f6af055b8daaa42b0b5b04a768..b29df8e876519cbd604b2a026bfb6703ca3f022b 100644 (file)
@@ -166,7 +166,7 @@ AVOutputFormat libnut_muxer = {
 #endif //CONFIG_MUXERS
 
 static int nut_probe(AVProbeData *p) {
-    if (p->buf_size >= ID_LENGTH && !memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
+    if (!memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
 
     return 0;
 }
index 591530490c1496d5b7bb65fa4990b781770ea231..414342288ad57d915fbd5a4d3c5880a112ac9726 100644 (file)
@@ -1074,9 +1074,6 @@ matroska_probe (AVProbeData *p)
     int len_mask = 0x80, size = 1, n = 1;
     uint8_t probe_data[] = { 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' };
 
-    if (p->buf_size < 5)
-        return 0;
-
     /* ebml header? */
     if ((p->buf[0] << 24 | p->buf[1] << 16 |
          p->buf[2] << 8 | p->buf[3]) != EBML_ID_HEADER)
index 443b709294c6c23966e39e4980debfb8e590698e..a7a67e9f00137cca247a4e1bf8693136bf84abbb 100644 (file)
@@ -59,8 +59,6 @@ typedef struct {
 static int mm_probe(AVProbeData *p)
 {
     /* the first chunk is always the header */
-    if (p->buf_size < MM_PREAMBLE_SIZE)
-        return 0;
     if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER)
         return 0;
     if (AV_RL32(&p->buf[2]) != MM_HEADER_LEN_V && AV_RL32(&p->buf[2]) != MM_HEADER_LEN_AV)
index 40b1a497cc60f8492a2216ae284f369fc2cf7c85..e395587002ee44b1f42204a3050b94ccb6a8f736 100644 (file)
@@ -168,8 +168,6 @@ static int mmf_write_trailer(AVFormatContext *s)
 static int mmf_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
     if (p->buf[0] == 'M' && p->buf[1] == 'M' &&
         p->buf[2] == 'M' && p->buf[3] == 'D' &&
         p->buf[8] == 'C' && p->buf[9] == 'N' &&
index e9b577576ba43a938f3d4f013dd5b1c03cd3dc17..b138e3c523451f3672526a001031f691d7162eef 100644 (file)
@@ -1320,8 +1320,6 @@ static int mov_probe(AVProbeData *p)
     int score = 0;
 
     /* check file header */
-    if (p->buf_size <= 12)
-        return 0;
     offset = 0;
     for(;;) {
         /* ignore invalid offset */
index e86ea14c802a018475ed164f31c0b16254222d70..60066a7797b2adbe51a747c30e8a893c84c1081f 100644 (file)
@@ -252,9 +252,6 @@ static int mp3_read_probe(AVProbeData *p)
     uint8_t *buf, *buf2, *end;
     AVCodecContext avctx;
 
-    if(p->buf_size < ID3_HEADER_SIZE)
-        return 0;
-
     if(id3_match(p->buf))
         return AVPROBE_SCORE_MAX/2+1; // this must be less then mpeg-ps because some retards put id3 tage before mpeg-ps files
 
index a28efb16d7e65691ccda48fc325cf981a8d8f2ea..5e75f16334996238b1cd2cab1e5e10c636c021fd 100644 (file)
@@ -42,8 +42,6 @@ typedef struct {
 static int mpc_probe(AVProbeData *p)
 {
     const uint8_t *d = p->buf;
-    if (p->buf_size < 32)
-        return 0;
     if (d[0] == 'M' && d[1] == 'P' && d[2] == '+' && (d[3] == 0x17 || d[3] == 0x7))
         return AVPROBE_SCORE_MAX;
     if (d[0] == 'I' && d[1] == 'D' && d[2] == '3')
index ae47fa60ac1f2e7426d0c6acd13391c881d9e5a4..40a7a259f24942dae0bd48fa889cfd31948c3cc1 100644 (file)
@@ -1260,8 +1260,6 @@ static int mpeg_mux_end(AVFormatContext *ctx)
 static int cdxa_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
     if (p->buf[0] == 'R' && p->buf[1] == 'I' &&
         p->buf[2] == 'F' && p->buf[3] == 'F' &&
         p->buf[8] == 'C' && p->buf[9] == 'D' &&
index 55800867e8931227151a71172d13674420499733..88a077ccd8f64b0e1c2ce2247aff659ee162174b 100644 (file)
@@ -54,9 +54,6 @@ typedef struct MTVDemuxContext {
 
 static int mtv_probe(AVProbeData *p)
 {
-    if(p->buf_size < 3)
-        return 0;
-
     /* Magic is 'AMV' */
 
     if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
index 2753edbd996d6b30a7a2648e51687cba685b1687..988dab21dfad146d992022a8c800065c82e7cd5a 100644 (file)
@@ -728,8 +728,6 @@ static int nsv_probe(AVProbeData *p)
     int i;
 //    PRINT(("nsv_probe(), buf_size %d\n", p->buf_size));
     /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
     if (p->buf[0] == 'N' && p->buf[1] == 'S' &&
         p->buf[2] == 'V' && p->buf[3] == 'f')
         return AVPROBE_SCORE_MAX;
index 7e04222eead873d1df7340b2a209fac656648a67..feb1d3060a4e856ee9ceb18a623369b24c1b6ff1 100644 (file)
@@ -35,8 +35,6 @@ typedef enum {
 } frametype_t;
 
 static int nuv_probe(AVProbeData *p) {
-    if (p->buf_size < 12)
-        return 0;
     if (!memcmp(p->buf, "NuppelVideo", 12))
         return AVPROBE_SCORE_MAX;
     if (!memcmp(p->buf, "MythTVVideo", 12))
index 8ca7b2d136f40eeb96daa8972142ec799720007d..a3739556e4412b66596a16be5ae0b2b1f8183256 100644 (file)
@@ -676,8 +676,6 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
 
 static int ogg_probe(AVProbeData *p)
 {
-    if (p->buf_size < 6)
-        return 0;
     if (p->buf[0] == 'O' && p->buf[1] == 'g' &&
         p->buf[2] == 'g' && p->buf[3] == 'S' &&
         p->buf[4] == 0x0 && p->buf[5] <= 0x7 )
index 73a20379ae2610cc274e243f305c9d0e09f2eda2..32b439b01695eb3f6b55290cb15148d12e9615b4 100644 (file)
@@ -382,8 +382,6 @@ static int h263_probe(AVProbeData *p)
     int code;
     const uint8_t *d;
 
-    if (p->buf_size < 6)
-        return 0;
     d = p->buf;
     code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
     if (code == 0x20) {
@@ -397,8 +395,6 @@ static int h261_probe(AVProbeData *p)
     int code;
     const uint8_t *d;
 
-    if (p->buf_size < 6)
-        return 0;
     d = p->buf;
     code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
     if (code == 0x10) {
index ad2f5ff27c8b5200ad5cc112460e08ccda24bd29..d2e41acbb6fec7b7eab0af67e9db5c125bc0c3d3 100644 (file)
@@ -1063,8 +1063,6 @@ static int rm_read_close(AVFormatContext *s)
 static int rm_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
     if ((p->buf[0] == '.' && p->buf[1] == 'R' &&
          p->buf[2] == 'M' && p->buf[3] == 'F' &&
          p->buf[4] == 0 && p->buf[5] == 0) ||
index b5375ccf7347c8d119e3fa8cca82d587adce9be5..5990047f0b9cd2f78a9b20478c370cc0e9f506ef 100644 (file)
@@ -66,9 +66,6 @@ typedef struct FilmDemuxContext {
 
 static int film_probe(AVProbeData *p)
 {
-    if (p->buf_size < 4)
-        return 0;
-
     if (AV_RB32(&p->buf[0]) != FILM_TAG)
         return 0;
 
index 3e1c8597dbea008f623344147c2d55aa7aa8e139..eba0bbb9e3a1d0965377177271ebc272714352dc 100644 (file)
@@ -59,9 +59,6 @@ typedef struct VmdDemuxContext {
 
 static int vmd_probe(AVProbeData *p)
 {
-    if (p->buf_size < 2)
-        return 0;
-
     /* check if the first 2 bytes of the file contain the appropriate size
      * of a VMD header chunk */
     if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
index 04fde3d037735ead750f60061dc31e50879db6aa..7a784c7d4c9a945e521f932ba62014fca305bbb1 100644 (file)
@@ -88,8 +88,6 @@ static const uint8_t smk_pal[64] = {
 
 static int smacker_probe(AVProbeData *p)
 {
-    if (p->buf_size < 4)
-        return 0;
     if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'
         && (p->buf[3] == '2' || p->buf[3] == '4'))
         return AVPROBE_SCORE_MAX;
index 951ec6eb9ab34d3e4ba69187417a97e9ecc5c567..6ab70eef04e2e305fb3e542dd7bee7209b08bf08 100644 (file)
@@ -35,8 +35,6 @@ static int sol_probe(AVProbeData *p)
 {
     /* check file header */
     uint16_t magic;
-    if (p->buf_size <= 14)
-        return 0;
     magic=le2me_16(*((uint16_t*)p->buf));
     if ((magic == 0x0B8D || magic == 0x0C0D || magic == 0x0C8D) &&
         p->buf[2] == 'S' && p->buf[3] == 'O' &&
index 7d889af7d0b7a51397024f35e48ec29c257d2246..f8f21462a315b97ff0f3f89efa81e73b1ae04f63 100644 (file)
@@ -618,8 +618,6 @@ static int get_swf_tag(ByteIOContext *pb, int *len_ptr)
 static int swf_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 16)
-        return 0;
     if ((p->buf[0] == 'F' || p->buf[0] == 'C') && p->buf[1] == 'W' &&
         p->buf[2] == 'S')
         return AVPROBE_SCORE_MAX;
index 1b7567e78ea3a98cb310bc95f251ebf123836351..f0fcfa9f5e73452b816f52ff7a45dd19e81291ef 100644 (file)
@@ -47,9 +47,6 @@ typedef struct ThpDemuxContext {
 static int thp_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size < 4)
-        return 0;
-
     if (AV_RL32(p->buf) == MKTAG('T', 'H', 'P', '\0'))
         return AVPROBE_SCORE_MAX;
     else
index a3709437ee7baac46bd90126f8f8b84fd455e44e..821d6ab9c57e425d505cfd372293b4a9745e457e 100644 (file)
@@ -29,8 +29,6 @@ typedef struct {
 static int tta_probe(AVProbeData *p)
 {
     const uint8_t *d = p->buf;
-    if (p->buf_size < 4)
-        return 0;
     if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')
         return 80;
     return 0;
index d062948b4c8cb37714e8e88f78e8bb3b83776dae..dec67fa8475995ad0682c59712822a28f9d4fe40 100644 (file)
@@ -429,7 +429,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
         for(probe_size= PROBE_BUF_MIN; probe_size<=PROBE_BUF_MAX && !fmt; probe_size<<=1){
             int score= probe_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX/4 : 0;
             /* read probe data */
-            pd->buf= av_realloc(pd->buf, probe_size);
+            pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE);
             pd->buf_size = get_buffer(pb, pd->buf, probe_size);
             if (url_fseek(pb, 0, SEEK_SET) < 0) {
                 url_fclose(pb);
index 85d304dff8773653f7f316e5d8e26afffc72cd18..c91baa6db96b0f98559513b1d513265b39998687 100644 (file)
@@ -28,8 +28,6 @@ static int voc_probe(AVProbeData *p)
 {
     int version, check;
 
-    if (p->buf_size < 26)
-        return 0;
     if (memcmp(p->buf, voc_magic, sizeof(voc_magic) - 1))
         return 0;
     version = p->buf[22] | (p->buf[23] << 8);
index 70214ae00f8d9e7413090e9b877e15b21bbf32da..a0a6ba34577f181ee61fb9e95c689158e72bbde2 100644 (file)
@@ -386,8 +386,6 @@ static int yuv4_read_close(AVFormatContext *s)
 static int yuv4_probe(AVProbeData *pd)
 {
     /* check file header */
-    if (pd->buf_size <= sizeof(Y4M_MAGIC))
-        return 0;
     if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC)-1)==0)
         return AVPROBE_SCORE_MAX;
     else