audio: Don't call a NULL function pointer when clearing audio streams.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2017 21:23:51 -0500
changeset 107767e935b2c430f
parent 10775 d8a4f8a929b2
child 10777 2883d23b5a28
audio: Don't call a NULL function pointer when clearing audio streams.

(Partially?) fixes Bugzilla #3547.
src/audio/SDL_audiocvt.c
     1.1 --- a/src/audio/SDL_audiocvt.c	Fri Jan 06 21:17:33 2017 -0500
     1.2 +++ b/src/audio/SDL_audiocvt.c	Fri Jan 06 21:23:51 2017 -0500
     1.3 @@ -998,7 +998,9 @@
     1.4          SDL_InvalidParamError("stream");
     1.5      } else {
     1.6          SDL_ClearDataQueue(stream->queue, stream->packetlen * 2);
     1.7 -        stream->reset_resampler_func(stream);
     1.8 +        if (stream->reset_resampler_func) {
     1.9 +            stream->reset_resampler_func(stream);
    1.10 +        }
    1.11      }
    1.12  }
    1.13