Commit 7becc703 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavf/amr: Fix heuristic to avoid detection of repeated bytes.

parent 4ac88ba5
......@@ -184,12 +184,11 @@ static int amrnb_probe(AVProbeData *p)
while (i < p->buf_size) {
mode = b[i] >> 3 & 0x0F;
if (mode < 9 && (b[i] & 0x4) == 0x4) {
int last = mode;
int last = b[i];
int size = amrnb_packed_size[mode];
while (size--) {
if (b[++i] != last)
break;
last = b[i];
}
if (size > 0) {
valid++;
......@@ -241,12 +240,11 @@ static int amrwb_probe(AVProbeData *p)
while (i < p->buf_size) {
mode = b[i] >> 3 & 0x0F;
if (mode < 10 && (b[i] & 0x4) == 0x4) {
int last = mode;
int last = b[i];
int size = amrwb_packed_size[mode];
while (size--) {
if (b[++i] != last)
break;
last = b[i];
}
if (size > 0) {
valid++;
......
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