Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log: check for QSizeF::isValid() in Log::validHtml() #2478

Merged
merged 1 commit into from Jul 31, 2016

Conversation

@SuperNascher
Copy link
Contributor

commented Jul 31, 2016

A fix to #2477 because it is possible to create an element with width and height that is to long for qreal.

@mkrautz

This comment has been minimized.

Copy link
Member

commented Jul 31, 2016

A fix to #2477 because it is possible to create an element with width and height that is to long for qreal.

Actually, that doesn't seem to be exactly what's happening. The values we use should be within DBL_MAX or std::numeric_limits<double>::max(), so it must be doing something internally that mangles the resulting QSize.

Also, can you use something like this for the commit title/body? Thanks. :-)

Log: check for QSizeF::isValid() in Log::validHtml().

It is possible for QTextDocument::size() to return
invalid sizes. For example, very big img tags with
sizes such as 33554451x33554451 cause QTextDocument
to return a QSizeF with a negative width or height.

This commits adds a call to QSizeF::isValid() to ensure
we treat QSizeFs with negative sizes as invalid.

Fixes mumble-voip/mumble#2477
@mkrautz

This comment has been minimized.

Copy link
Member

commented Jul 31, 2016

Also, I believe the time on your commit is a bit off?

@SuperNascher SuperNascher force-pushed the SuperNascher:message_overflow branch from ffee68e to 95f842a Jul 31, 2016

@SuperNascher SuperNascher changed the title Check if the message size is valid Log: check for QSizeF::isValid() in Log::validHtml(). Jul 31, 2016

@SuperNascher SuperNascher changed the title Log: check for QSizeF::isValid() in Log::validHtml(). Log: check for QSizeF::isValid() in Log::validHtml() Jul 31, 2016

Log: check for QSizeF::isValid() in Log::validHtml().
It is possible for QTextDocument::size() to return
invalid sizes. For example, very big img tags with
sizes such as 33554451x33554451 cause QTextDocument
to return a QSizeF with a negative width or height.

This commits adds a call to QSizeF::isValid() to ensure
we treat QSizeFs with negative sizes as invalid.

Fixes #2477

@SuperNascher SuperNascher force-pushed the SuperNascher:message_overflow branch from 95f842a to fb19de1 Jul 31, 2016

@mkrautz mkrautz merged commit b126c4e into mumble-voip:master Jul 31, 2016

@SuperNascher SuperNascher deleted the SuperNascher:message_overflow branch Aug 2, 2016

@mkrautz mkrautz referenced this pull request Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.