summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-07 08:44:29 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-07 08:44:29 -0400
commit95b9f872882b367556ca2330eea8c8309db542e6 (patch)
tree63023d59c8d9d1f91f4102436519a1d849f61fb0 /api/user.go
parent982c9eeceba2a31f709cfb2a1b259b518f0ca0df (diff)
parent122a67c3b45548bd0d091a398c8d7c2a884681e6 (diff)
downloadchat-95b9f872882b367556ca2330eea8c8309db542e6.tar.gz
chat-95b9f872882b367556ca2330eea8c8309db542e6.tar.bz2
chat-95b9f872882b367556ca2330eea8c8309db542e6.zip
Merge pull request #141 from hmhealey/profilepicture32bit
Fix an out of bounds exception when generating profile pictures on 32 bit installations
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/user.go b/api/user.go
index 292d2b61b..ada781bc7 100644
--- a/api/user.go
+++ b/api/user.go
@@ -593,7 +593,7 @@ func createProfileImage(username string, userId string) ([]byte, *model.AppError
h.Write([]byte(userId))
seed := h.Sum32()
- color := colors[int(seed)%len(colors)]
+ color := colors[int64(seed)%int64(len(colors))]
img := image.NewRGBA(image.Rect(0, 0, int(utils.Cfg.ImageSettings.ProfileWidth), int(utils.Cfg.ImageSettings.ProfileHeight)))
draw.Draw(img, img.Bounds(), &image.Uniform{color}, image.ZP, draw.Src)