avcodec/sgi: Fix dereferencing uninitialized pointer

This also fixes the code so it decodes raw images correctly again
No release is affected by this

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
