diff options
author | Steve Kondik <shade@chemlab.org> | 2014-07-25 05:33:22 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2014-07-25 05:33:22 -0700 |
commit | a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f (patch) | |
tree | a5d0d048e3976331e7001ed2eea256c67dc10b2a /libFLAC/md5.c | |
parent | d3c04b5f963ef86e1aeb74656151f175aefa4c48 (diff) | |
download | android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.tar.gz android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.tar.bz2 android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.zip |
Upgrade to libFLAC 1.3.0cm-11.0-XNPH44S-bacon-5fa8c79c0bcm-11.0-XNPH05Q-tomato-9828f8e9cccm-11.0-XNPH05Q-bacon-5229c4ef56stable/cm-11.0-XNG3Cstable/cm-11.0-XNG2Sstable/cm-11.0-XNF9Xstable/cm-11.0-XNF8Ystable/cm-11.0shipping/cm-11.0
Change-Id: Ibd991640b7c85a96f4d1a43381acd199a6d197fd
Diffstat (limited to 'libFLAC/md5.c')
-rw-r--r-- | libFLAC/md5.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libFLAC/md5.c b/libFLAC/md5.c index 37cef67..e251d50 100644 --- a/libFLAC/md5.c +++ b/libFLAC/md5.c @@ -8,10 +8,6 @@ #include "private/md5.h" #include "share/alloc.h" -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was @@ -143,7 +139,7 @@ static void byteSwap(FLAC__uint32 *buf, unsigned words) { register FLAC__uint32 x; do { - x = *buf; + x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); } while (--words); @@ -263,12 +259,12 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx) byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ if(0 != ctx->internal_buf) { free(ctx->internal_buf); ctx->internal_buf = 0; ctx->capacity = 0; } + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* @@ -406,13 +402,14 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const return false; if(ctx->capacity < bytes_needed) { - FLAC__byte *tmp = (FLAC__byte*)realloc(ctx->internal_buf, bytes_needed); + FLAC__byte *tmp = realloc(ctx->internal_buf, bytes_needed); if(0 == tmp) { free(ctx->internal_buf); - if(0 == (ctx->internal_buf = (FLAC__byte*)safe_malloc_(bytes_needed))) + if(0 == (ctx->internal_buf = safe_malloc_(bytes_needed))) return false; } - ctx->internal_buf = tmp; + else + ctx->internal_buf = tmp; ctx->capacity = bytes_needed; } |