Read WAV frames in chunks instead of trusting the header count
The PCM frame count declared by a WAV header is untrusted. Both
QDrWavAudioDecoder and QSampleCache sized their output buffer up
front from that count, so a crafted file with a huge or wrapping
frame count could trigger an enormous allocation or an integer
overflow. Add a QtMultimediaPrivate::readFramesInChunks() helper
that grows the buffer chunk by chunk as frames are actually
produced, and fails unless exactly the declared frame count is
read.
Fixes: QTBUG-151155
Pick-to: 6.12
Change-Id: I32c9e77cfd29857b8f08f085fe7c77553cb3e3fd
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>