<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 2, 2016 at 12:41 AM, Stefan Dösinger <span dir="ltr"><<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<span class=""><br>
Am 2016-01-01 um 18:15 schrieb Aaryaman Vasishta:<br>
> +        expected = (info_header.biWidth + 3) & ~3;<br>
> +        ok(expected == img->bytes_per_line, "Expected bytes per line == %d, got %d.\n", expected, img->bytes_per_line);<br>
> +        if (depth == 8)<br>
> +        {<br>
> +            for (i = 0; i < h; i++)<br>
> +            {<br>
> +                offset = upside_down ? (img->bytes_per_line * (h - i - 1)) : (img->bytes_per_line * i);<br>
> +                for (j = 0; j < img->bytes_per_line; j++)<br>
> +                {<br>
> +                    if (buffer1[k++] != buffer2[offset++])<br>
> +                        return FALSE;<br>
> +                }<br>
</span>You want j < img->width here, otherwise you compare the padded bytes<br>
against the next line of the input image. (You'll then also compare the<br>
follow-up lines incorrectly and read past the input buffer). It works<br>
here because you pass an image with a width that's a multiple of 4 when<br>
this codepath is used.<br>
<br>
So iterate over width pixels, but advance the read offset / pointer by<br>
bytes_per_line bytes after processing one line.<br></blockquote><div>It seems for any 8bpp image loaded by d3drm, the bytes_per_line is always == width regardless of whether the width is a multiple of 4 or not. So there's essentially no padding between lines. Hence, using bytes_per_line instead of width here doesn't really make a difference.<br><br>I've sent a try 7 with the other changes we discussed on IRC, but if you want me to change this to use img->width instead of bytes_per_line I don't mind that either. <br></div></div><br></div></div>