Fix use after free bug in FfmpegDecoder.

This commit is contained in:
casey langen 2021-09-20 08:18:25 -07:00
parent 042c857895
commit 0497260ddb

View File

@ -251,6 +251,10 @@ void FfmpegDecoder::Reset() {
av_audio_fifo_free(this->outputFifo); av_audio_fifo_free(this->outputFifo);
this->outputFifo = nullptr; this->outputFifo = nullptr;
} }
if (this->resampler) {
swr_free(&this->resampler);
this->resampler = nullptr;
}
this->streamId = -1; this->streamId = -1;
} }
@ -479,9 +483,6 @@ bool FfmpegDecoder::DrainResamplerToFifoQueue() {
} }
} }
swr_free(&this->resampler);
this->resampler = nullptr;
return true; return true;
} }