I have a script that uses `fread` to copy a bmp data to a buffer type `byte** BUFF;`
I use the buffer with the format of: `BUFF[nImages][Data];` after the dynamic alocation.
That part works well, however...

The problem is when i try to render the content. The image goes curved, as you can see on the left. The image on the right is the original one.
![Right one is the original](https://i.stack.imgur.com/y2iS2.png)

The code i use to render the image is:

```
word ofs = 54;

byte sgetc (byte *str)
{
    return str[ofs++];
}

void bmp_drawfbuff ()
{
    word WIDTH, HEIGHT, W, H;
    byte R, G, B;

    HEIGHT = BMPDATA[0][18] + BMPDATA[0][19] * 256;
    WIDTH = BMPDATA[0][22] + BMPDATA[0][23] * 256;

    for(W=0; W<WIDTH; W++)
    {
        for(H=0; H<HEIGHT; H++)
        {
            B = sgetc(BMPDATA[0]);
            G = sgetc(BMPDATA[0]);
            R = sgetc(BMPDATA[0]);

            setpen(R, G, B, 0, 1);
            putpixel(W, H);
        }
    }
}

```

Just to note that the same code, with `fseek` and `fgetc` works, when rendering directly from a file. What am i doing wrong?

**UPDATE:**

![enter image description here](https://i.stack.imgur.com/QyEuX.png)