[FFmpeg-devel] [PATCH 1/2] lavu/hash: Fix adler32 calculation

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 15 23:05:14 CEST 2013


On Wed, May 15, 2013 at 05:52:39PM -0300, James Almer wrote:
> Adler must be initialized with a non zero value
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavutil/hash.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavutil/hash.c b/libavutil/hash.c
> index 80bf164..bea2952 100644
> --- a/libavutil/hash.c
> +++ b/libavutil/hash.c
> @@ -116,7 +116,7 @@ void av_hash_init(AVHashContext *ctx)
>      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 ADLER32: ctx->crc = 1; break;

That on its own will make CRC32 behave a bit strange.
Might be better to keep the behaviour, even if the next patch obsoletes
it.


More information about the ffmpeg-devel mailing list