From 2fa33d6f987d706752430556ef779a047d85acb0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 12 Jun 2019 15:43:08 -0400 Subject: [PATCH] wave: Fixed static analysis warning about dead assignment. (technically, this function never returns an error at this point, but since it _does_ have an "uhoh, is this corrupt data?" comment that it ignores, we should probably make sure we handle error cases in the future. :) ) --- src/audio/SDL_wave.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 6390bec061640..18d2c267fc853 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -1107,9 +1107,11 @@ IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) /* Initialize decoder with the values from the block header. */ result = IMA_ADPCM_DecodeBlockHeader(&state); + if (result == 0) { + /* Decode the block data. It stores the samples directly in the output. */ + result = IMA_ADPCM_DecodeBlockData(&state); + } - /* Decode the block data. It stores the samples directly in the output. */ - result = IMA_ADPCM_DecodeBlockData(&state); if (result == -1) { /* Unexpected end. Stop decoding and return partial data if necessary. */ if (file->trunchint == TruncVeryStrict || file->trunchint == TruncVeryStrict) {