Por que o BitmapSource.Create lança um ArgumentException?

Eu estou tentando obter um bitmap criado a partir de dados brutos para mostrar no WPF, usando uma imagem e um BitmapSource:

Int32[] data = new Int32[RenderHeight * RenderWidth];

for (Int32 i = 0; i < RenderHeight; i++)
{
    for (Int32 j = 0; j < RenderWidth; j++)
    {
        Int32 index = j + (i * RenderHeight);

        if (i + j % 2 == 0)
            data[index] = 0xFF0000;
        else
            data[index] = 0x00FF00;
    }
}

BitmapSource source = BitmapSource.Create(RenderWidth, RenderHeight, 96.0, 96.0, PixelFormats.Bgr32, null, data, 0);

RenderImage.Source = source;

No entanto, a chamada para BitmapSource.Create lança um ArgumentException, dizendo "Valor não está dentro do intervalo esperado". Não é este o caminho para fazer isso? Eu não estou fazendo essa chamada corretamente?

questionAnswers(1)

yourAnswerToTheQuestion