15 lines
445 B
Text
15 lines
445 B
Text
Index: k2pdfoptlib/textrows.c
|
|
--- k2pdfoptlib/textrows.c.orig
|
|
+++ k2pdfoptlib/textrows.c
|
|
@@ -956,6 +956,11 @@ static int maxval(int *x,int n,int n0,int dx,int *inde
|
|
if (imax<0 || x[i]>x[imax])
|
|
imax=i;
|
|
}
|
|
+ if (imax < 0) /* handle negative index by returning the first entry */
|
|
+ if (index)
|
|
+ (*index)=0;
|
|
+ return(x[0]);
|
|
+
|
|
if (index!=NULL)
|
|
(*index)=imax+n0;
|
|
return(x[imax]);
|