# HG changeset patch # User aurel # Date 1217896922 0 # Node ID e630d4110478316b6b392c3029a22da48f5a9140 # Parent cdd58525b41cfe55c0d76e1bda4ac58c58e7edc4 matroskadec: Use string instead of char table as probe data comparison source. diff -r cdd58525b41c -r e630d4110478 matroskadec.c --- a/matroskadec.c Tue Aug 05 00:41:59 2008 +0000 +++ b/matroskadec.c Tue Aug 05 00:42:02 2008 +0000 @@ -855,7 +855,7 @@ { uint64_t total = 0; int len_mask = 0x80, size = 1, n = 1; - uint8_t probe_data[] = { 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' }; + char probe_data[] = "matroska"; /* ebml header? */ if (AV_RB32(p->buf) != EBML_ID_HEADER) @@ -881,8 +881,8 @@ * we don't parse the whole header but simply check for the * availability of that array of characters inside the header. * Not fully fool-proof, but good enough. */ - for (n = 4 + size; n <= 4 + size + total - sizeof(probe_data); n++) - if (!memcmp (&p->buf[n], probe_data, sizeof(probe_data))) + for (n = 4+size; n <= 4+size+total-(sizeof(probe_data)-1); n++) + if (!memcmp(p->buf+n, probe_data, sizeof(probe_data)-1)) return AVPROBE_SCORE_MAX; return 0;