The returned pointer is probably to a char (byte) array.
When you're converting it to an int pointer pointer arithmetics will have it so that p + (i * 4) will refer to the i * 4:th pixel; I believe you want to step through each byte rather than do that. Still, you most likely should have more than 400 pixels locked so I don't really see why it should crash.
Does it give any particular error message / can you use the stack trace to find something out?
Edit: Just tried the following which runs just fine for me:
void testIt() {
dbLockPixels();
char *ptr = (char*)dbGetPixelsPointer();
for(int p = 0; p < 100; p++)
*(ptr + (p * 4) + 1) = 255;
dbUnlockPixels();
}
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)