Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2013-05-16 01:34:58 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-05-16 01:53:40 +0400
commitc55c715c81dec16de1c4a55faf0c595e18fff1e5 (patch)
tree479830ca9c7cf7f369080f7701fc420f33bf4f25 /libavutil/hash.c
parent42af97dbc0fa3beff04c2685d0c13ce335b14589 (diff)
lavu/hash: Fix adler32 calculation
Adler must be initialized with a non zero value. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/hash.c')
-rw-r--r--libavutil/hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavutil/hash.c b/libavutil/hash.c
index 80bf164a1b..a08d2cf731 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -115,8 +115,8 @@ void av_hash_init(AVHashContext *ctx)
case SHA160: av_sha_init(ctx->ctx, 160); break;
case SHA224: av_sha_init(ctx->ctx, 224); break;
case SHA256: av_sha_init(ctx->ctx, 256); break;
- case CRC32:
- case ADLER32: ctx->crc = 0; break;
+ case CRC32: ctx->crc = 0; break;
+ case ADLER32: ctx->crc = 1; break;
}
}
@@ -141,8 +141,8 @@ void av_hash_final(AVHashContext *ctx, uint8_t *dst)
case SHA160:
case SHA224:
case SHA256: av_sha_final(ctx->ctx, dst); break;
- case CRC32:
- case ADLER32: AV_WL32(dst, ctx->crc); break;
+ case CRC32: AV_WL32(dst, ctx->crc); break;
+ case ADLER32: AV_WB32(dst, ctx->crc); break;
}
}