Ticket #1044 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

nband and nbands not crash-safe

Reported by: robe Owned by: pracine
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: trunk
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

Changed 2 years ago by dustymugs

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

Changed 2 years ago by robe

  • status changed from new to closed
  • resolution set to fixed

Yap that fixes the crash and gives a warning.

Note: See TracTickets for help on using tickets.