diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2002-10-23 10:46:37 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2002-10-23 10:46:37 +0000 |
commit | 40703dea6c6e5b3be113fe5cdfa619396d6d008b (patch) | |
tree | ae04a8eb8c5205ba2c379ab4d6cc961e09ed751e | |
parent | 582bfbf129e4c2ae651b40c4c8e9038b17816ae2 (diff) | |
download | xine-lib-40703dea6c6e5b3be113fe5cdfa619396d6d008b.tar.gz xine-lib-40703dea6c6e5b3be113fe5cdfa619396d6d008b.tar.bz2 |
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
-rw-r--r-- | src/demuxers/demux_film.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |