Opened 15 years ago

Closed 15 years ago

#2712 closed enhancement (fixed)

Check the input data type in GDALWMSDataset::Initialize()

Reported by: dron Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:
Cc: nowakpl

Description

Adam,

A client of mine suggested the following patch for the WMS driver:

    if (ret == CE_None) {
        const char *data_type = CPLGetXMLValue(config, "DataType", "Byte");
        m_data_type = GDALGetDataTypeByName( data_type );
        if ( m_data_type == GDT_Unknown || m_data_type >= GDT_TypeCount )
        {
            CPLError( CE_Failure, CPLE_AppDefined,
                      "GDALWMS: Invalid value in DataType. Data type \"%s\" is not supported.", data_type );
            ret = CE_Failure;
        }
    }

Its goal is to catch the situation when we have something different from GDT_Byte on input datasource. Is it OK with you if I will go forward and apply that patch?

Best regards,
Andrey

Change History (2)

comment:1 by nowakpl, 15 years ago

Looks fine but opens a possibility of color table with other than byte data type and this would not work correctly.

comment:2 by dron, 15 years ago

Resolution: fixed
Status: newclosed

Ok, I've checked in this one (r15865).

Note: See TracTickets for help on using tickets.