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

Qt4: Avoid a potential division by zero



Fixes an annoying crash for me.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent b4cf8ccc
......@@ -303,8 +303,10 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
QPoint target( event->globalX() - ( event->x() - posX ),
QWidget::mapToGlobal( QPoint( 0, 0 ) ).y() );
secstotimestr( psz_length, ( ( posX - margin ) * inputLength ) / ( size().width() - handleLength() ) );
mTimeTooltip->setTip( target, psz_length, chapterLabel );
if( likely( size().width() > handleLength() ) ) {
secstotimestr( psz_length, ( ( posX - margin ) * inputLength ) / ( size().width() - handleLength() ) );
mTimeTooltip->setTip( target, psz_length, chapterLabel );
}
}
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