[FFmpeg-cvslog] random_seed: fix out of array read

Michael Niedermayer git at videolan.org
Thu Oct 11 18:32:56 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 11 18:27:21 2012 +0200| [7fe55485315201ea2ca540e6e337bfaf4af086c5] | committer: Michael Niedermayer

random_seed: fix out of array read

Fixes CID733787
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fe55485315201ea2ca540e6e337bfaf4af086c5
---

 libavutil/random_seed.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index d1a1fa6..b594e82 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -95,7 +95,7 @@ static uint32_t get_generic_seed(void)
     av_sha_init(sha, 160);
     av_sha_update(sha, (uint8_t*)buffer, sizeof(buffer));
     av_sha_final(sha, digest);
-    return AV_RB32(digest) + AV_RB32(digest+32);
+    return AV_RB32(digest) + AV_RB32(digest+16);
 }
 
 uint32_t av_get_random_seed(void)



More information about the ffmpeg-cvslog mailing list