Commit 6b93370c authored by aurel's avatar aurel

matroskadec: use string instead of char table as probe data comparision source

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14592 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ee510b22
...@@ -855,7 +855,7 @@ matroska_probe (AVProbeData *p) ...@@ -855,7 +855,7 @@ matroska_probe (AVProbeData *p)
{ {
uint64_t total = 0; uint64_t total = 0;
int len_mask = 0x80, size = 1, n = 1; 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? */ /* ebml header? */
if (AV_RB32(p->buf) != EBML_ID_HEADER) if (AV_RB32(p->buf) != EBML_ID_HEADER)
...@@ -881,8 +881,8 @@ matroska_probe (AVProbeData *p) ...@@ -881,8 +881,8 @@ matroska_probe (AVProbeData *p)
* we don't parse the whole header but simply check for the * we don't parse the whole header but simply check for the
* availability of that array of characters inside the header. * availability of that array of characters inside the header.
* Not fully fool-proof, but good enough. */ * Not fully fool-proof, but good enough. */
for (n = 4 + size; n <= 4 + size + total - sizeof(probe_data); n++) for (n = 4+size; n <= 4+size+total-(sizeof(probe_data)-1); n++)
if (!memcmp (&p->buf[n], probe_data, sizeof(probe_data))) if (!memcmp(p->buf+n, probe_data, sizeof(probe_data)-1))
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment