Browse Source

ffmpeg: Fix crash cleaning up audio/video context

rdb 5 years ago
parent
commit
90fb31ac21

+ 1 - 1
panda/src/ffmpeg/ffmpegAudioCursor.cxx

@@ -224,7 +224,7 @@ cleanup() {
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 52, 0)
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 52, 0)
     avcodec_free_context(&_audio_ctx);
     avcodec_free_context(&_audio_ctx);
 #else
 #else
-    delete _audio_ctx;
+    av_free(_audio_ctx);
 #endif
 #endif
   }
   }
   _audio_ctx = nullptr;
   _audio_ctx = nullptr;

+ 1 - 1
panda/src/ffmpeg/ffmpegVideoCursor.cxx

@@ -607,7 +607,7 @@ close_stream() {
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 52, 0)
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 52, 0)
     avcodec_free_context(&_video_ctx);
     avcodec_free_context(&_video_ctx);
 #else
 #else
-    delete _video_ctx;
+    av_free(_video_ctx);
 #endif
 #endif
   }
   }
   _video_ctx = nullptr;
   _video_ctx = nullptr;