Do you have a variable named p_frame in your cpp file ? Whatever the case is, I would recommend trying to go with a lower value since it says out of bounds. Trying something lower than 6 should do the trick. Play around with numbers as vertical frames * horizontal frames = 6 is definitely out of bounds. I'm sure someone else knows about this problem since I'm just guessing and saw it for the first time too !