iccvid/tests: Reserve enough memory for input in test_formats (ASan).

ASan got triggered by the new iccvid test.

In ICCVID_DecompressGetFormat the input pointer gets read 484 (40+111*4) bytes, but variable in gets just the size of BITMAPINFOHEADER, 40 bytes allocated.

CC: @zfigura

Testbot run with this patch

ASan details link
==iccvid_test.exe==1720==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x0022f8e8 at pc 0x784543e2 bp 0x0022f1f0 sp 0x0022edc0
READ of size 484 at 0x0022f8e8 thread T0
    #0 0x784543e1 in __asan_memcpy /home/runner/work/llvm-mingw/llvm-mingw/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:65:3
    #1 0x77fd22aa in ICCVID_DecompressGetFormat /builds/bernhardu/wine/build64/../dlls/iccvid/iccvid.c:836:9
    #2 0x77fd1351 in ICCVID_DriverProc /builds/bernhardu/wine/build64/../dlls/iccvid/iccvid.c:1015:16
    #3 0x78e92cf3 in DRIVER_SendMessage /builds/bernhardu/wine/build64/../dlls/winmm/driver.c:130:11
    #4 0x78e92ba8 in SendDriverMessage /builds/bernhardu/wine/build64/../dlls/winmm/driver.c:150:11
    #5 0x7902d7e0 in MSVIDEO_SendMessage /builds/bernhardu/wine/build64/../dlls/msvfw32/msvideo_main.c:198:15
    #6 0x7902db20 in ICSendMessage /builds/bernhardu/wine/build64/../dlls/msvfw32/msvideo_main.c:1163:12
    #7 0x0040190d in test_formats /builds/bernhardu/wine/build64/../dlls/iccvid/tests/iccvid.c:62:11
    #8 0x004010d9 in func_iccvid /builds/bernhardu/wine/build64/../dlls/iccvid/tests/iccvid.c:196:5
    #9 0x00404f51 in run_test /builds/bernhardu/wine/build64/../include/wine/test.h:780:5
    #10 0x00404a6b in main /builds/bernhardu/wine/build64/../include/wine/test.h
    #11 0x00405f05 in mainCRTStartup /builds/bernhardu/wine/build64/../dlls/msvcrt/crt_main.c:62:11
    #12 0x7bcd367f in BaseThreadInitThunk (C:\windows\system32\kernel32.dll+0x7b82367f)
    #13 0x7be4680a in call_thread_func_wrapper (C:\windows\system32\ntdll.dll+0x7bc4680a)
    #14 0x7be4717a in call_thread_func /builds/bernhardu/wine/build64/../dlls/ntdll/signal_i386.c:503:9
Address 0x0022f8e8 is located in stack of thread T0 at offset 1256 in frame
    #0 0x0040149f in test_formats /builds/bernhardu/wine/build64/../dlls/iccvid/tests/iccvid.c:25
  This frame has 3 object(s):
    [16, 1080) 'buffer' (line 26)
    [1216, 1256) 'in' (line 27)
    [1296, 1864) 'info' (line 30) <== Memory access at offset 1256 partially underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp, SEH and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /builds/bernhardu/wine/build64/../dlls/iccvid/iccvid.c:836:9 in ICCVID_DecompressGetFormat

Merge request reports

Loading