Another bounds check

This commit is contained in:
Neale Pickett 2022-09-25 12:39:57 -06:00
parent 98b6afccde
commit b380917400
1 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,11 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
return
}
if img.Bounds().Max.X != 8 || img.Bounds().Max.Y != 8 {
http.Error(w, "Invalid frame size", http.StatusBadRequest)
return
}
// Dump it to the raw file
for y := 0; y < 8; y++ {
for x := 0; x < 8; x++ {