summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLawrence Rust <lvr@softsystem.co.uk>2012-01-15 17:30:41 (GMT)
committer Gavin Hurlbut <ghurlbut@mythtv.org>2012-01-29 07:03:41 (GMT)
commit50b459419b1c79f311c2b7f56ba0fd64f8562ec8 (patch)
tree330c8ee8230117a2368bb6d642e7155e18fba3f8
parenta4d27a4ad98dfd75fc724abd501e89c64deb0679 (diff)
mythtranscode: Avoid a floating point exception
Closes #10263 When mythtranscode is run with a non default profile it can throw a flating point exception during initialisation: Program terminated with signal 8, Arithmetic exception. 422 if ((ydiff / display_video_rect.height()) < 0.05) (gdb) bt new_display_visible_rect=..., new_aspectoverride=kAspect_Off, new_adjustfill=kAdjustFill_AutoDetect_DefaultHalf) at videooutwindow.cpp:484 winh=0, codec_id=kCodec_MPEG2, embedid=0) at videooutbase.cpp:419 winw=0, winh=0, codec_id=kCodec_MPEG2, embedid=0) at videoout_null.cpp:152 framecontrol=false, jobID=-1, fifodir=..., fifo_info=false, deleteMap=...) at transcode.cpp:716 This is caused by display_video_rect.height() being 0. Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk> Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org>
-rw-r--r--mythtv/libs/libmythtv/videooutwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp
index 9bd7d75..35b3013 100644
--- a/mythtv/libs/libmythtv/videooutwindow.cpp
+++ b/mythtv/libs/libmythtv/videooutwindow.cpp
@@ -444,6 +444,9 @@ void VideoOutWindow::ApplySnapToVideoRect(void)
if (pip_state > kPIPOff)
return;
+ if (display_video_rect.height() == 0 || display_video_rect.width() == 0)
+ return;
+
float ydiff = abs(display_video_rect.height() - video_rect.height());
if ((ydiff / display_video_rect.height()) < 0.05)
{