Cleanup on bug 3894 - Fuzzing crashes for SDL_LoadWAV

Simon Hug

Attached is a minor cleanup patch. It changes the option name of one hint to something better, puts one or two more checks in, and adds explicit casting where warnings could appear otherwise.

I hope the naming of the hints and their options is acceptable. It would be kind of awkward to change them after they get released with an official SDL version.
This commit is contained in:
Sam Lantinga
2019-06-09 12:46:10 -07:00
parent b5e9ebbafa
commit 762b788f67
3 changed files with 56 additions and 50 deletions

View File

@@ -103,10 +103,10 @@ typedef struct WaveChunk
/* Controls how the size of the RIFF chunk affects the loading of a WAVE file. */
typedef enum WaveRiffSizeHint {
RiffSizeNoHint,
RiffSizeChunkSearch,
RiffSizeForce,
RiffSizeIgnoreZero,
RiffSizeIgnore,
RiffSizeMaximum,
RiffSizeMaximum
} WaveRiffSizeHint;
/* Controls how a truncated WAVE file is handled. */
@@ -115,7 +115,7 @@ typedef enum WaveTruncationHint {
TruncVeryStrict,
TruncStrict,
TruncDropFrame,
TruncDropBlock,
TruncDropBlock
} WaveTruncationHint;
/* Controls how the fact chunk affects the loading of a WAVE file. */
@@ -124,7 +124,7 @@ typedef enum WaveFactChunkHint {
FactTruncate,
FactStrict,
FactIgnoreZero,
FactIgnore,
FactIgnore
} WaveFactChunkHint;
typedef struct WaveFile