libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 5f934c35fb33d3194b7d8a11b01ceb074734434d
parent 17ea404eecb94a08f6209bb099485ea9c1dba4ef
Author: Heikki Lindholm <holin@iki.fi>
Date:   Thu, 27 Dec 2007 11:12:01 +0000

clean up, make parser more strict


Diffstat:
Msrc/plugins/flvextractor.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/plugins/flvextractor.c b/src/plugins/flvextractor.c @@ -27,6 +27,8 @@ #define DEBUG 0 +#define FLV_SIGNATURE "FLV" + static struct EXTRACTOR_Keywords * addKeyword (EXTRACTOR_KeywordType type, char *keyword, struct EXTRACTOR_Keywords *next) @@ -107,6 +109,8 @@ static int readFLVHeader(const unsigned char **data, hdr->version = *ptr++; hdr->flags = *ptr++; hdr->offset = readBEInt32(&ptr); + if (hdr->offset != FLV_HEADER_SIZE) + return -1; *data = ptr; return 0; @@ -319,7 +323,7 @@ libextractor_flv_extract (const char *filename, if (readFLVHeader(&ptr, end, &header) == -1) return prev; - if (memcmp(header.signature, "FLV", 3) != 0) + if (memcmp(header.signature, FLV_SIGNATURE, 3) != 0) return prev; result = prev;