Skip to content
Snippets Groups Projects
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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b4cf8ccc
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment