[FFmpeg-cvslog] yop_probe: check more fields to avoid detecting random data as yop

Michael Niedermayer git at videolan.org
Thu May 31 15:57:49 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 31 14:47:15 2012 +0200| [76170f537304cc845d6d334d36daa0a0f16efb32] | committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76170f537304cc845d6d334d36daa0a0f16efb32
---

 libavformat/yop.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/yop.c b/libavformat/yop.c
index e8f4e8e..c7d3f65 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -38,10 +38,15 @@ typedef struct yop_dec_context {
 static int yop_probe(AVProbeData *probe_packet)
 {
     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[7]                         &&
         !(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 0;



More information about the ffmpeg-cvslog mailing list