From b7e2c242d61c763d8af6e229083089b9ac6a02ec Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 19 Apr 2013 14:49:23 +0200 Subject: [PATCH] dvbsubtitle: Fix segfault in destructor Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1fb105b361356c7bc342b9c3dc79d978967443ee Author: Michael Liebmann Date: 2013-04-19 (Fri, 19 Apr 2013) Origin message was: ------------------ * dvbsubtitle: Fix segfault in destructor ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libdvbsub/dvbsubtitle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }