AVWrapper: Error message when g_pAFrame is broken
authorWuzzy <Wuzzy2@mail.ru>
Tue, 14 May 2019 20:58:39 +0200
changeset 14966 00cf807b7faa
parent 14965 8b53cb1c0ada
child 14967 23fc5022bdea
AVWrapper: Error message when g_pAFrame is broken
hedgewars/avwrapper/avwrapper.c
--- a/hedgewars/avwrapper/avwrapper.c	Tue May 14 21:36:50 2019 +0300
+++ b/hedgewars/avwrapper/avwrapper.c	Tue May 14 20:58:39 2019 +0200
@@ -367,6 +367,8 @@
         VideoTime = (double)g_pVFrame->pts * g_pVStream->time_base.num/g_pVStream->time_base.den;
         do
         {
+            if (!g_pAFrame)
+                return FatalError("Error while writing video frame: g_pAFrame does not exist");
             AudioTime = (double)g_pAFrame->pts * g_pAStream->time_base.num/g_pAStream->time_base.den;
             ret = WriteAudioFrame();
         }