What on earth is wrong with this code?!

This is a function in an active object:

iDecoder = CImageDecoder:ataNewL(iFs, aImageData, aMimeType);
TFrameInfo frameInfo = iDecoder->FrameInfo(0);
TRect imageSize = frameInfo.iFrameCoordsInPixels;
iImage = new(ELeave) CFbsBitmap;
iImage->Create(imageSize.Size(), EColor4K);
TRAPD(err, iDecoder->Convert(&iStatus, *iImage));
// over here, err = 0 and iStatus = KErrUnknown BEFORE it even exits this function!

P.S. This code executes in a server context (EXE) not within an app.