[totem-pl-parser] Fix check_header, -1 isn't a value for an unsigned int...



commit 0e04fa6ed33ab4c627f4f45c9ef9672afb8113c9
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Apr 29 01:03:56 2009 +0100

    Fix check_header, -1 isn't a value for an unsigned int...
    
    2009-04-29  Bastien Nocera  <hadess hadess net>
    
    	* plparse/totem-pl-parser-podcast.c (check_header),
    	(decompress_gzip): Fix check_header, -1 isn't a value
    	for an unsigned int...
---
 ChangeLog                         |    6 ++++++
 plparse/totem-pl-parser-podcast.c |    8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 903931b..6400de1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-29  Bastien Nocera  <hadess hadess net>
+
+	* plparse/totem-pl-parser-podcast.c (check_header),
+	(decompress_gzip): Fix check_header, -1 isn't a value
+	for an unsigned int...
+
 2009-04-24  Bastien Nocera  <hadess hadess net>
 
         * plparse/totem-pl-parser.c (totem_pl_parser_parse_xml_relaxed):
diff --git a/plparse/totem-pl-parser-podcast.c b/plparse/totem-pl-parser-podcast.c
index e57e0c7..f912889 100644
--- a/plparse/totem-pl-parser-podcast.c
+++ b/plparse/totem-pl-parser-podcast.c
@@ -570,16 +570,16 @@ check_header (char *data, gsize len)
 	unsigned flags;
 
 	if (len < 2 + 1 + 1 + 6)
-		return -1;
+		return 0;
 
 	/* Check signature */
 	if (memcmp (data, signature, sizeof (signature)) != 0)
-		return -1;
+		return 0;
 
 	/* verify flags and compression type */
 	flags  = data[3];
 	if (data[2] != Z_DEFLATED || (flags & ~GZIP_HEADER_FLAGS) != 0)
-		return -1;
+		return 0;
 
 	/* Get the uncompressed size */
 	/* FIXME, but how?  The size read here is modulo 2^32.  */
@@ -595,7 +595,7 @@ decompress_gzip (char *data, gsize len)
 	z_stream  stream;
 
 	retlen = check_header (data, len);
-	if (retlen < 0)
+	if (retlen == 0)
 		return NULL;
 
 	stream.zalloc    = (alloc_func)0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]