changeset 3229:7eefc6e4f6d4

magic_number checking added
author alex
date Fri, 30 Nov 2001 20:50:08 +0000
parents fd1bbd90d87a
children 697c115d7d79
files libmpdemux/demux_fli.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_fli.c	Fri Nov 30 19:56:08 2001 +0000
+++ b/libmpdemux/demux_fli.c	Fri Nov 30 20:50:08 2001 +0000
@@ -65,8 +65,19 @@
   demuxer->movi_start = 128;
   demuxer->movi_end = stream_read_dword_le(demuxer->stream);
 
+#if 0
   // skip the magic number
   stream_skip(demuxer->stream, 2);
+#else
+  magic_number = stream_read_word_le(demuxer->stream);
+  
+  if ((magic_number != 0xAF11) && (magic_number != 0xAF12))
+  {
+    mp_msg(MSGT_DEMUX, MSGL_ERR, "Bad/unknown magic number (%04x)\n",
+	magic_number);
+    return(NULL);    
+  }
+#endif
 
   // fetch the number of frames
   frames->num_frames = stream_read_word_le(demuxer->stream);
@@ -101,6 +112,10 @@
   speed = stream_read_word_le(demuxer->stream);
   if (speed == 0)
     speed = 1;
+#if 0
+  if (magic_number == 0xAF11)
+    speed *= 1000/70;
+#endif
   sh_video->fps = 1000 / speed;
   sh_video->frametime = 1/sh_video->fps;