mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 01:32:42 +00:00
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.
This commit is contained in:
parent
16cd84e633
commit
c7a7548481
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-04-19 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* 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 <slomo@circular-chaos.org>
|
2008-04-19 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/gsturi.c: (gst_uri_protocol_check_internal),
|
* gst/gsturi.c: (gst_uri_protocol_check_internal),
|
||||||
|
|
|
@ -122,6 +122,7 @@
|
||||||
/* Changes for gstreamer:
|
/* Changes for gstreamer:
|
||||||
* - Changed to use GLib data types
|
* - Changed to use GLib data types
|
||||||
* - Change function name to _gst_crc32
|
* - 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
|
static guint32
|
||||||
_gst_crc32 (guint32 crc, const gchar * buf, guint len)
|
_gst_crc32 (guint32 crc, const gchar * buf, guint len)
|
||||||
{
|
{
|
||||||
if (buf == NULL)
|
if (buf == NULL || len == 0)
|
||||||
return 0L;
|
return crc;
|
||||||
|
|
||||||
crc = crc ^ 0xffffffffL;
|
crc = crc ^ 0xffffffffL;
|
||||||
while (len >= 8) {
|
while (len >= 8) {
|
||||||
DO8 (buf);
|
DO8 (buf);
|
||||||
|
|
Loading…
Reference in a new issue