Ncnn: Mat::from_pixels_resize出现错误

Created on 25 Apr 2019  ·  5Comments  ·  Source: Tencent/ncnn

在ios平台出现错误
int w = 128;
int h = 128;
int target_width = 144;
int target_height = 144;

unsigned char* pixels = (unsigned char*)malloc(w*3*h);
ncnn::Mat::from_pixels_resize(pixels,  ncnn::Mat::PIXEL_RGB2BGR,  w,  h,  target_width,  target_height);

如上,不是每一次都会出错,是偶现的,w=256,h=256也会出现同样的问题,目前我们是把resize的neon关闭,才能避免此问题。

bug

Most helpful comment

All 5 comments

同问下

1、ncnn::resize_bilinear_c1(unsigned char const, int, int, unsigned char, int, int), mat_pixel_resize.cpp,line 156,col 31

2、ncnn::conv3x3s1_neon(ncnn::Mat const&, ncnn::Mat&, ncnn::Mat const&, ncnn::Mat const&, ncnn::Option const&), convolution_3x3.h,line 90,col 17

3、ncnn::resize_bilinear_c3(unsigned char const, int, int, unsigned char, int, int), mat_pixel_resize.cpp,line 716,col 33
这几个地方是高危区

bilinear resize c2 c3 的 hresize 有越界读操作(并没有使用),某些硬件上会导致 crash

同样256*256 crash,换了新版本解决

Was this page helpful?
0 / 5 - 0 ratings

Related issues

baiyecha picture baiyecha  ·  3Comments

xhappy picture xhappy  ·  5Comments

mychina75 picture mychina75  ·  4Comments

lovehuanhuan picture lovehuanhuan  ·  3Comments

varbegin picture varbegin  ·  3Comments