Verified Commit 1fb9e731 authored by Thomas Bernard's avatar Thomas Bernard 💬
Browse files

tif_luv.c: LogLuvSetupEncode() error must return 0

see http://bugzilla.maptools.org/show_bug.cgi?id=2848

if wrongly returning 1, the processing of incorrect file continues,
which causes problems.
parent e3d73827
......@@ -1507,7 +1507,7 @@ LogLuvSetupEncode(TIFF* tif)
switch (td->td_photometric) {
case PHOTOMETRIC_LOGLUV:
if (!LogLuvInitState(tif))
break;
return (0);
if (td->td_compression == COMPRESSION_SGILOG24) {
tif->tif_encoderow = LogLuvEncode24;
switch (sp->user_datafmt) {
......@@ -1540,7 +1540,7 @@ LogLuvSetupEncode(TIFF* tif)
break;
case PHOTOMETRIC_LOGL:
if (!LogL16InitState(tif))
break;
return (0);
tif->tif_encoderow = LogL16Encode;
switch (sp->user_datafmt) {
case SGILOGDATAFMT_FLOAT:
......@@ -1556,7 +1556,7 @@ LogLuvSetupEncode(TIFF* tif)
TIFFErrorExt(tif->tif_clientdata, module,
"Inappropriate photometric interpretation %d for SGILog compression; %s",
td->td_photometric, "must be either LogLUV or LogL");
break;
return (0);
}
sp->encoder_state = 1;
return (1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment