@@ -5000,13 +5000,16 @@ static int loadOutputFormat(mapObj *map)
5000
5000
format -> renderer = MS_RENDER_WITH_GD ;
5001
5001
#endif
5002
5002
}
5003
-
5004
- format -> numformatoptions = numformatoptions ;
5005
- if ( numformatoptions > 0 ) {
5006
- format -> formatoptions = (char * * )
5007
- msSmallMalloc (sizeof (char * )* numformatoptions );
5008
- memcpy ( format -> formatoptions , formatoptions ,
5009
- sizeof (char * )* numformatoptions );
5003
+ while (numformatoptions -- ) {
5004
+ char * key = strchr (formatoptions [numformatoptions ],'=' );
5005
+ if (!key || !* (key + 1 )) {
5006
+ msSetError (MS_MISCERR ,"Failed to parse FORMATOPTION, expecting \"KEY=VALUE\" syntax." ,"loadOutputFormat()" );
5007
+ goto load_output_error ;
5008
+ }
5009
+ * key = 0 ;
5010
+ key ++ ;
5011
+ msSetOutputFormatOption (format ,formatoptions [numformatoptions ],key );
5012
+ free (formatoptions [numformatoptions ]);
5010
5013
}
5011
5014
5012
5015
format -> inmapfile = MS_TRUE ;
@@ -5047,8 +5050,7 @@ static int loadOutputFormat(mapObj *map)
5047
5050
if (getString (& value ) == MS_FAILURE )
5048
5051
goto load_output_error ;
5049
5052
if ( numformatoptions < MAX_FORMATOPTIONS )
5050
- formatoptions [numformatoptions ++ ] = msStrdup (value );
5051
- free (value );
5053
+ formatoptions [numformatoptions ++ ] = value ;
5052
5054
value = NULL ;
5053
5055
break ;
5054
5056
case (IMAGEMODE ):
0 commit comments