Opened 13 years ago

Closed 13 years ago

#1044 closed defect (fixed)

nband and nbands not crash-safe

Reported by: robe Owned by: pracine
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

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;

Change History (2)

comment:1 by Bborie Park, 13 years ago

Can you try r7440? I believe I've fixed the crash.

comment:2 by robe, 13 years ago

Resolution: fixed
Status: newclosed

Yap that fixes the crash and gives a warning.

Note: See TracTickets for help on using tickets.