Simple Directmedia Layer

Fix size of memcpy in SDL_AudioDeviceFormatChangedAlreadyLocked And add diagnostic that allows to find this kind of issue in clang-tidy

authored by Mathieu Eyraud and committed by Ryan C. Gordon 778e8185 4bb426ab

Changed files
+2 -1
src
audio
+1
.clang-tidy
··· 25 clang-analyzer-core.*, 26 clang-analyzer-valist.*, 27 clang-analyzer-unix.Malloc, 28 google-readability-casting, 29 misc-misleading-bidirectional, 30 misc-misleading-identifier,
··· 25 clang-analyzer-core.*, 26 clang-analyzer-valist.*, 27 clang-analyzer-unix.Malloc, 28 + clang-diagnostic-*, 29 google-readability-casting, 30 misc-misleading-bidirectional, 31 misc-misleading-identifier,
+1 -1
src/audio/SDL_audio.c
··· 1681 const SDL_bool iscapture = device->iscapture; 1682 1683 if ((device->spec.format != newspec->format) || (device->spec.channels != newspec->channels) || (device->spec.freq != newspec->freq)) { 1684 - SDL_memcpy(&device->spec, newspec, sizeof (newspec)); 1685 for (SDL_LogicalAudioDevice *logdev = device->logical_devices; !kill_device && (logdev != NULL); logdev = logdev->next) { 1686 for (SDL_AudioStream *stream = logdev->bound_streams; !kill_device && (stream != NULL); stream = stream->next_binding) { 1687 if (SDL_SetAudioStreamFormat(stream, iscapture ? &device->spec : NULL, iscapture ? NULL : &device->spec) == -1) {
··· 1681 const SDL_bool iscapture = device->iscapture; 1682 1683 if ((device->spec.format != newspec->format) || (device->spec.channels != newspec->channels) || (device->spec.freq != newspec->freq)) { 1684 + SDL_memcpy(&device->spec, newspec, sizeof (*newspec)); 1685 for (SDL_LogicalAudioDevice *logdev = device->logical_devices; !kill_device && (logdev != NULL); logdev = logdev->next) { 1686 for (SDL_AudioStream *stream = logdev->bound_streams; !kill_device && (stream != NULL); stream = stream->next_binding) { 1687 if (SDL_SetAudioStreamFormat(stream, iscapture ? &device->spec : NULL, iscapture ? NULL : &device->spec) == -1) {