From 40703dea6c6e5b3be113fe5cdfa619396d6d008b Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Wed, 23 Oct 2002 10:46:37 +0000 Subject: Check the FILM signature, before we trust the data in some random file. The FILM demuxer was allocating 1.5GB of data, when an .avi file should be opened CVS patchset: 2960 CVS date: 2002/10/23 10:46:37 --- src/demuxers/demux_film.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index a8a82670d..415605c62 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.35 2002/10/22 04:08:47 tmmm Exp $ + * $Id: demux_film.c,v 1.36 2002/10/23 10:46:37 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -146,11 +146,16 @@ static int open_film_file(demux_film_t *film) { /* reset the file */ film->input->seek(film->input, 0, SEEK_SET); - /* get the header length and file version */ + /* get the signature, header length and file version */ if (film->input->read(film->input, scratch, 16) != 16) { return 0; } + /* FILM signature correct? */ + if (strncmp(scratch, "FILM", 4)) { + return 0; + } + /* header size = header size - 16-byte FILM signature */ film_header_size = BE_32(&scratch[4]) - 16; film_header = xine_xmalloc(film_header_size); -- cgit v1.2.3