From: Sebastian Dröge Date: Sat, 19 Apr 2008 15:42:19 +0000 (+0000) Subject: gst/gstregistrybinary.c: Return the old CRC instead of 0 if we give a NULL buffer... X-Git-Tag: RELEASE-0_10_20~122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7a754848190888305c26865a8ef6211c9ded396;p=platform%2Fupstream%2Fgstreamer.git gst/gstregistrybinary.c: Return the old CRC instead of 0 if we give a NULL buffer or a buffer with a length of 0. Original commit message from CVS: * gst/gstregistrybinary.c: (_gst_crc32): Return the old CRC instead of 0 if we give a NULL buffer or a buffer with a length of 0. --- diff --git a/ChangeLog b/ChangeLog index d30d15e..63b6dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-04-19 Sebastian Dröge + * gst/gstregistrybinary.c: (_gst_crc32): + Return the old CRC instead of 0 if we give a NULL buffer + or a buffer with a length of 0. + +2008-04-19 Sebastian Dröge + * gst/gsturi.c: (gst_uri_protocol_check_internal), (gst_uri_get_protocol), (gst_uri_has_protocol), (gst_uri_construct), (gst_uri_handler_set_uri): diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index 926b197..d810c80 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -122,6 +122,7 @@ /* Changes for gstreamer: * - Changed to use GLib data types * - Change function name to _gst_crc32 + * - Return the old CRC instead of 0 when len or buf are 0/NULL */ /* ======================================================================== @@ -192,8 +193,9 @@ static const guint32 crc_table[256] = { static guint32 _gst_crc32 (guint32 crc, const gchar * buf, guint len) { - if (buf == NULL) - return 0L; + if (buf == NULL || len == 0) + return crc; + crc = crc ^ 0xffffffffL; while (len >= 8) { DO8 (buf);