Commit 76170f53 authored by Michael Niedermayer's avatar Michael Niedermayer

yop_probe: check more fields to avoid detecting random data as yop

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 60de7616
...@@ -38,10 +38,15 @@ typedef struct yop_dec_context { ...@@ -38,10 +38,15 @@ typedef struct yop_dec_context {
static int yop_probe(AVProbeData *probe_packet) static int yop_probe(AVProbeData *probe_packet)
{ {
if (AV_RB16(probe_packet->buf) == AV_RB16("YO") && if (AV_RB16(probe_packet->buf) == AV_RB16("YO") &&
probe_packet->buf[2]<10 &&
probe_packet->buf[3]<10 &&
probe_packet->buf[6] && probe_packet->buf[6] &&
probe_packet->buf[7] && probe_packet->buf[7] &&
!(probe_packet->buf[8] & 1) && !(probe_packet->buf[8] & 1) &&
!(probe_packet->buf[10] & 1)) !(probe_packet->buf[10] & 1) &&
AV_RL16(probe_packet->buf + 12 + 6) >= 920 &&
AV_RL16(probe_packet->buf + 12 + 6) < probe_packet->buf[12] * 3 + 4 + probe_packet->buf[7] * 2048
)
return AVPROBE_SCORE_MAX * 3 / 4; return AVPROBE_SCORE_MAX * 3 / 4;
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