msrle32: Use the correct number of colors when biClrUsed = 0 (try 2)

Bruno Jesus 00cpxxx at gmail.com
Tue Mar 15 01:08:58 CDT 2016


On Tuesday, March 15, 2016, Alexandre Julliard <julliard at winehq.org
<javascript:_e(%7B%7D,'cvml','julliard at winehq.org');>> wrote:

> Bruno Jesus <00cpxxx at gmail.com> writes:
>
> > @@ -1647,27 +1655,33 @@ static LRESULT DecompressBegin(CodecInfo *pi,
> LPCBITMAPINFOHEADER lpbiIn,
> >
> >    if (lpbiIn->biCompression != BI_RGB)
> >    {
> > +    int colors;
> > +
> > +    if (lpbiIn->biClrUsed == 0)
> > +      colors = 1 << lpbiIn->biBitCount;
> > +    else
> > +      colors = lpbiIn->biClrUsed;
>
> I don't think you want to do that for biBitCount > 8.


I'm not near the source code now but AFAIR DecompressQuery would refuse
such bitmap because it does not support biClrUsed > 0 when bit count > 8.
But I will clarify that in a third version, certainly it would be a waste
of memory to allocate memory unnecessarely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160315/bf3ace7d/attachment.html>


More information about the wine-devel mailing list