summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-08-05 00:42:02 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-08-05 00:42:02 +0000
commit104be2404e16a58810bd8866bb7c59837ee93ed3 (patch)
tree442bdeafae60d0edec7262d2b317a8a50d15102f /libavformat/matroskadec.c
parenteb05caccf2e2de346862ade234e17c5b1c242336 (diff)
matroskadec: Use string instead of char table as probe data comparison source.
Originally committed as revision 14592 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 9334ce2a15..ae2a61b240 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -855,7 +855,7 @@ matroska_probe (AVProbeData *p)
{
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 @@ matroska_probe (AVProbeData *p)
* 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;