Commit b930eb8
committed
get_all_media(): Do not crash on custom page size range entries
The media-col-database IPP attribute contains one entry for each valid
combination of page size dimensions, margins, and in some cases also
media source and media type.
If custom page sizes are supported, this is represented by one
media-col-database entry (usually the last one) where the width and
length dimensions are ranges, consisting of 2 numbers each. The
get_all_media() tried to read those as normal intergers, getting back
0 and this cause NULL being returned by pwgMediaForSize() function and
a segfault when trying to get the PWG name of the page size.
This is now fixed by skipping the entry for the custom page size
(actually we need to support custom page sizes).1 parent 669abda commit b930eb8
1 file changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
1235 | | - | |
1236 | | - | |
1237 | 1235 | | |
1238 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1239 | 1252 | | |
1240 | 1253 | | |
1241 | 1254 | | |
| |||
1245 | 1258 | | |
1246 | 1259 | | |
1247 | 1260 | | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | 1261 | | |
1259 | 1262 | | |
1260 | 1263 | | |
| |||
0 commit comments