[postgis-devel] [PostGIS] #1044: nband and nbands not crash-safe

PostGIS trac at osgeo.org
Mon Jun 20 19:57:30 PDT 2011


#1044: nband and nbands  not crash-safe
----------------------------+-----------------------------------------------
 Reporter:  robe            |       Owner:  pracine      
     Type:  defect          |      Status:  new          
 Priority:  blocker         |   Milestone:  PostGIS 2.0.0
Component:  postgis raster  |     Version:  trunk        
 Keywords:                  |  
----------------------------+-----------------------------------------------
 For at least the output functions like ST_AsPNG and ST_AsJPEG, if I pass
 in a band number or in the nbands add a band that is higher than my number
 of bands, it crashes the server.

 e.g.


 {{{
 SELECT ST_AsJPEG(rast,80) As rastjpg
     FROM dummy_rast WHERE rid=2;
 }}}

 Note in this example I accidentally assumed the second arg was quality,
 but it was band number and it crashed my postgres service

 Same thing happens if I do this (I only have 3 bands)


 {{{
 SELECT ST_AsJPEG(rast,ARRAY[2,1,3,4],ARRAY['QUALITY=90','PROGRESSIVE=ON'])
 As rastjpg
     FROM dummy_rast WHERE rid=2;
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1044>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list