diff options
author | Jeremy Mates <jeremy.mates@gmail.com> | 2021-05-14 11:34:42 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2021-05-14 11:34:42 -0400 |
commit | e0adae1b8e19f9bedc4cb1a3798736812cb490a6 (patch) | |
tree | e18e6f01a744d1267d2415986757ca23ecebe252 | |
parent | f0b589b685cc3d9f684d9423250f798a8f93142f (diff) |
bitmap: Fix a crash with underspecified dimensions
From the reporter on #xorg-devel:
-!- thrig [thrig@unaffilaited/thrig] has joined #xorg-devel
<thrig> where does the code for bitmap live? there's a crash (or who
knows on some platforms) if you `bitmap -size 42`
-rw-r--r-- | Bitmap.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -963,12 +963,14 @@ BWParseSize(String size, Dimension *width, Dimension *height) status = XParseGeometry(size, &x, &y, &w, &h); - if (status & (WidthValue | HeightValue)) { + if (status & WidthValue) { *width = (Dimension) w; - *height = (Dimension) h; - return True; + if (status & HeightValue) { + *height = (Dimension) h; + return True; + } } - else return False; + return False; } |