aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-03 18:01:26 +0100
committerMans Rullgard <mans@mansr.com>2011-07-03 18:19:19 +0100
commitfa49fc72d9f25c1b2dccf7a4c43aa9b027e80e4b (patch)
treefe5f3f077fecb0fc5ca192cd7e912d59f00ac70d /libavutil
parent8b53755ebd8310bfa9d92013712d2abc07af59ef (diff)
downloadffmpeg-fa49fc72d9f25c1b2dccf7a4c43aa9b027e80e4b.tar.gz
md5: use AV_WL32 to write result
This is simpler, safer, and removes the undocumented requirement of aligned output buffer. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/md5.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 74e109b72d..a06e5eae81 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -32,6 +32,7 @@
#include <stdint.h>
#include "bswap.h"
+#include "intreadwrite.h"
#include "md5.h"
typedef struct AVMD5{
@@ -150,7 +151,7 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst){
av_md5_update(ctx, (uint8_t*)&finalcount, 8);
for(i=0; i<4; i++)
- ((uint32_t*)dst)[i]= av_le2ne32(ctx->ABCD[3-i]);
+ AV_WL32(dst + 4*i, ctx->ABCD[3-i]);
}
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){