int minFilterSize;
double *filter=NULL;
double *filter2=NULL;
+ int ret= -1;
#if defined(ARCH_X86)
if (flags & SWS_CPU_CAPS_MMX)
asm volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
filterSize= (minFilterSize +(filterAlign-1)) & (~(filterAlign-1));
assert(filterSize > 0);
filter= av_malloc(filterSize*dstW*sizeof(double));
- if (filterSize >= MAX_FILTER_SIZE)
- return -1;
+ if (filterSize >= MAX_FILTER_SIZE || !filter)
+ goto error;
*outFilterSize= filterSize;
if (flags&SWS_PRINT_INFO)
else filter[i*filterSize + j]= filter2[i*filter2Size + j];
}
}
- av_freep(&filter2);
//FIXME try to align filterpos if possible
(*outFilter)[j + i]= (*outFilter)[j + i - (*outFilterSize)];
}
+ ret=0;
+error:
av_free(filter);
- return 0;
+ av_free(filter2);
+ return ret;
}
#ifdef COMPILE_MMX2