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

James Almer jamrial at gmail.com
Wed May 15 23:18:29 CEST 2013


On 15/05/13 6:05 PM, Reimar Döffinger wrote:
> 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.

Yes, i realized i made this mistake after sending the patch.
My intention was to keep CRC32 intact here before the next patch changed 
it, which is why i kept AV_WL32() for it.

Will send a new one in a sec.

Regards.


More information about the ffmpeg-devel mailing list