[llvm-rc] Read the Planes/BitCount fields from BITMAPINFOHEADER for icons
authorMartin Storsjo <martin@martin.st>
Tue, 15 May 2018 06:35:20 +0000 (06:35 +0000)
committerMartin Storsjo <martin@martin.st>
Tue, 15 May 2018 06:35:20 +0000 (06:35 +0000)
commit860e5fcdf4305c0681c4e77e17b22d2e54fe163b
treee6ab342b6301180bc62ec867d82e71fbd7371dac
parentb7d50115ba4900da6db7afb6460ad42ff19ba6a2
[llvm-rc] Read the Planes/BitCount fields from BITMAPINFOHEADER for icons

Previously these fields were only read from this header for cursors,
while Planes was hardcoded to 1 for icons (with a comment that it was
unknown why this was needed) and BitCount was left at the value
read originally in the RESDIRENTRY.

This fixes the single byte that was differing for the icon/cursor test
compared to rc.exe.

This is based on research/testing by Nico Weber.

Differential Revision: https://reviews.llvm.org/D46816

llvm-svn: 332328
llvm/test/tools/llvm-rc/tag-icon-cursor.test
llvm/tools/llvm-rc/ResourceFileWriter.cpp