@@ -229,8 +229,8 @@ typedef float RGBPRIMS[4][2]; /* (x,y) chromaticities for RGBW */
229
229
#define COLCORSTR "COLORCORR="
230
230
#define LCOLCORSTR 10
231
231
#define iscolcor (hl ) (!strncmp(hl, COLCORSTR, LCOLCORSTR))
232
- #define colcorval (cc , hl ) sscanf((hl) + LCOLCORSTR, "%f %f %f", \
233
- &(cc)[RED], &(cc)[GRN], &(cc)[BLU])
232
+ #define colcorval (cc , hl ) ( sscanf((hl) + LCOLCORSTR, "%f %f %f", \
233
+ &(cc)[RED], &(cc)[GRN], &(cc)[BLU]) == 3 )
234
234
235
235
#define MINELEN 8 /* minimum scanline length for encoding */
236
236
#define MAXELEN 0x7fff /* maximum scanline length for encoding */
@@ -643,15 +643,17 @@ rad2vips_process_line(char *line, Read *read)
643
643
COLOR cc ;
644
644
int i ;
645
645
646
- (void ) colcorval (cc , line );
646
+ if (!colcorval (cc , line ))
647
+ return -1 ;
647
648
for (i = 0 ; i < 3 ; i ++ )
648
649
read -> colcor [i ] *= cc [i ];
649
650
}
650
651
else if (isaspect (line )) {
651
652
read -> aspect *= aspectval (line );
652
653
}
653
654
else if (isprims (line )) {
654
- (void ) primsval (read -> prims , line );
655
+ if (!primsval (read -> prims , line ))
656
+ return -1 ;
655
657
}
656
658
657
659
return 0 ;
0 commit comments