1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00
wine/dlls/avifil32
Eric Pouech 52a83ffe4e avifil32: Fix GCC 12.2 warning (-Warray-bounds).
Since struct _IAVIStreamImpl has a pointer to a WAVEFORMATEX,
GCC 12.2 emits warning when dereferencing that pointer when
the block has been allocated with sizeof(PCMWAVEFORMAT).

The warning is fixed by always allocating with sizeof(WAVEFORMATEX).
This will overallocate in case of a PCM stream.

The alternative would have been to store in struct _IAVIStreamImpl
a pointer to PCMWAVEFORMAT instead, and add the casting to a
WAVEFORMATEX when needed. That would clutter the code IMO since most
of the ACM APIs expect a LPWAVEFORMATEX.

/home/eric/work/wine/dlls/avifil32/acmstream.c: In function 'AVIFILE_OpenCompressor':
/home/eric/work/wine/dlls/avifil32/acmstream.c:105:24: warning: array subscript 'struct tWAVEFORMATEX[0]' is partly outside array bounds of 'unsigned char[16]' [-Warray-bounds]
  105 |       This->lpOutFormat->wFormatTag = WAVE_FORMAT_PCM;
      |                        ^~
/home/eric/work/wine/dlls/avifil32/acmstream.c:101:27: note: object of size 16 allocated by 'HeapAlloc'
  101 |       This->lpOutFormat = HeapAlloc(GetProcessHeap(), 0, This->cbOutFormat);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-09-22 21:09:05 +02:00
..
tests avifil32/tests: Enable compilation with long types. 2022-02-23 10:17:25 +01:00
acmstream.c avifil32: Fix GCC 12.2 warning (-Warray-bounds). 2022-09-22 21:09:05 +02:00
api.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
avifil32.idl
avifil32.rc
avifil32.spec
avifile_private.h
avifile.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
avifile.rgs
editstream.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
extrachunk.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
extrachunk.h
factory.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
getframe.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
icmstream.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
Makefile.in avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
tmpfile.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00
wavfile.c avifil32: Enable compilation with long types. 2022-02-08 10:46:57 +01:00