Commit 8dd70b01 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Qt4: Avoid a potential division by zero

Fixes an annoying crash for me.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b4cf8ccc
...@@ -303,8 +303,10 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event ) ...@@ -303,8 +303,10 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
QPoint target( event->globalX() - ( event->x() - posX ), QPoint target( event->globalX() - ( event->x() - posX ),
QWidget::mapToGlobal( QPoint( 0, 0 ) ).y() ); QWidget::mapToGlobal( QPoint( 0, 0 ) ).y() );
secstotimestr( psz_length, ( ( posX - margin ) * inputLength ) / ( size().width() - handleLength() ) ); if( likely( size().width() > handleLength() ) ) {
mTimeTooltip->setTip( target, psz_length, chapterLabel ); secstotimestr( psz_length, ( ( posX - margin ) * inputLength ) / ( size().width() - handleLength() ) );
mTimeTooltip->setTip( target, psz_length, chapterLabel );
}
} }
event->accept(); event->accept();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment