switch (mng_get_alphadepth(handle)) { case 0:
il_mng_processheader(mng_handle handle, mng_uint32 width, mng_uint32 height){  EXTRACT_CONTAINER;  gfx_format format;  switch (mng_get_alphadepth(handle)) {  case 0:    format = gfxIFormats::RGB;    mng_set_canvasstyle(handle, MNG_CANVAS_RGB8);    break;  case 1:    format = gfxIFormats::RGB_A8;    mng_set_canvasstyle(handle, MNG_CANVAS_RGB8_A8);    break;  default:    format = gfxIFormats::RGB_A8;    mng_set_canvasstyle(handle, MNG_CANVAS_RGB8_A8);    break;  }#ifdef XP_PC  format += 1;#endif  nsMNGDecoder* decoder = container->mDecoder;  if (decoder->mObserver)    decoder->mObserver->OnStartDecode(nsnull, nsnull);  if(decoder->mImageContainer)    decoder->mImageContainer->Init(width,                                    height,                                   decoder->mObserver);  if (decoder->mObserver)    decoder->mObserver->OnStartContainer(nsnull,                                          nsnull,                                          decoder->mImageContainer);  // initalize the frame and append it to the container  decoder->mImageFrame = do_CreateInstance("@mozilla.org/gfx/image/frame;2");  decoder->mImageFrame->Init(0, 0, width, height, format);    decoder->mImageContainer->AppendFrame(decoder->mImageFrame);      if (decoder->mObserver)    decoder->mObserver->OnStartFrame(nsnull, nsnull, decoder->mImageFrame);  container->mFrame->GetImageBytesPerRow(&container->mByteWidth);  container->mFrame->GetAlphaBytesPerRow(&container->mByteWidthAlpha);  if ((format!=gfxIFormats::RGB) && (format!=gfxIFormats::BGR)) {    container->alpha =       (unsigned char*)nsMemory::Alloc(container->mByteWidthAlpha*height);    memset(container->alpha, 0, container->mByteWidthAlpha*height);  } else    container->alpha = 0;  container->image =     (unsigned char*)nsMemory::Alloc(container->mByteWidth*height);  memset(container->image, 0, container->mByteWidth*height);  return MNG_TRUE;}