fixed seg faults

This commit is contained in:
Vladislav Vinogradov 2015-03-05 18:38:36 +03:00
parent ee316758ca
commit f939d80f4c
2 changed files with 10 additions and 2 deletions

View File

@ -97,7 +97,11 @@ namespace cv { namespace gpu { namespace device
#endif
};
callers[borderMode](PtrStepSz<vec_type>(src), PtrStepSz<vec_type>(dst), top, left, borderValue, stream);
const caller_t caller = callers[borderMode];
if (!caller)
cv::gpu::error("Unsupported input parameters for copyMakeBorder", __FILE__, __LINE__, "");
caller(PtrStepSz<vec_type>(src), PtrStepSz<vec_type>(dst), top, left, borderValue, stream);
}
template void copyMakeBorder_gpu<uchar, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);

View File

@ -485,7 +485,11 @@ namespace cv { namespace gpu { namespace device
if (interpolation == 3 && (fx <= 1.f || fy <= 1.f))
interpolation = 1;
funcs[interpolation](static_cast< PtrStepSz<T> >(src), static_cast< PtrStepSz<T> >(srcWhole), yoff, xoff, static_cast< PtrStepSz<T> >(dst), fy, fx, stream);
const func_t func = funcs[interpolation];
if (!func)
cv::gpu::error("Unsupported input parameters for resize", __FILE__, __LINE__, "");
func(static_cast< PtrStepSz<T> >(src), static_cast< PtrStepSz<T> >(srcWhole), yoff, xoff, static_cast< PtrStepSz<T> >(dst), fy, fx, stream);
}
template void resize<uchar >(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);