Ticket #1950 (closed defect: fixed)
msOGRLayerGetAutoStyle passes NULL pointer to GetRGBFromString causing access violation
| Reported by: | szekerest | Owned by: | szekerest |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | OGR Support | Version: | 5.0 |
| Severity: | normal | Keywords: | |
| Cc: | dmorissette |
Description (last modified by dmorissette) (diff)
msOGRLayerGetAutoStyle may pass NULL pointer to GetRGBFromString causing access
violation.
In my test case the brush style in the OGR MapInfo tab file contains ForeColor
but does not contain BackColor style. In this case
poBrushStyle->BackColor(bIsNull) returns NULL and bIsNull = true;
To fix the problem the following code fragment is used:
pszColor = poBrushStyle->BackColor(bIsNull);
if (!bIsNull &&
poBrushStyle->GetRGBFromString(pszColor,r,g,b,t))
{
MS_INIT_COLOR(c->styles[0].backgroundcolor, r, g, b);
}
Change History
Note: See
TracTickets for help on using
tickets.
