ffmpegdec fix possible memleak (thx DboxOldie)

This commit is contained in:
BPanther
2019-03-04 21:58:37 +01:00
committed by Thilo Graf
parent 052d9c07f5
commit d1f4f82f6a
2 changed files with 15 additions and 15 deletions

View File

@@ -192,8 +192,8 @@ bool CFfmpegDec::Init(void *_in, const CFile::FileType /* ft */)
char buf[200]; av_strerror(r, buf, sizeof(buf));
fprintf(stderr, "%d %s %d: %s\n", __LINE__, __func__,r,buf);
if (avioc)
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1)
av_free(avc->pb);
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100))
av_free(avioc);
#else
avio_context_free(&avioc);
#endif
@@ -211,7 +211,7 @@ void CFfmpegDec::DeInit(void)
{
if (avc) {
if (avc->pb)
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1)
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100))
av_free(avc->pb);
#else
avio_context_free(&avc->pb);