diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index d3384ccf7..26134b02d 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -200,8 +200,11 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void) cDvbSubtitleConverter::~cDvbSubtitleConverter() { - avcodec_close(avctx); - av_free(avctx); + if (avctx) { + avcodec_close(avctx); + av_free(avctx); + avctx = NULL; + } delete bitmaps; }