Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 50b4594)
  • Loading branch information
Lawrence Rust authored and Beirdo committed Jan 29, 2012
1 parent 10d5624 commit 61d36f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mythtv/libs/libmythtv/videooutwindow.cpp
Expand Up @@ -418,6 +418,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)
{
Expand Down

0 comments on commit 61d36f5

Please sign in to comment.