1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Fixing some static analysis issues

This commit is contained in:
Maksim Shabunin
2017-06-26 14:09:21 +03:00
parent b991665b5d
commit 32d4af36e2
63 changed files with 238 additions and 94 deletions
+1
View File
@@ -96,6 +96,7 @@ ImageDecoder BaseImageDecoder::newDecoder() const
BaseImageEncoder::BaseImageEncoder()
{
m_buf = 0;
m_buf_supported = false;
}
+4 -1
View File
@@ -55,6 +55,9 @@ BmpDecoder::BmpDecoder()
m_signature = fmtSignBmp;
m_offset = -1;
m_buf_supported = true;
m_origin = 0;
m_bpp = 0;
m_rle_code = BMP_RGB;
}
@@ -191,7 +194,7 @@ bool BmpDecoder::readData( Mat& img )
uchar* data = img.ptr();
int step = (int)img.step;
bool color = img.channels() > 1;
uchar gray_palette[256];
uchar gray_palette[256] = {0};
bool result = false;
int src_pitch = ((m_width*(m_bpp != 15 ? m_bpp : 16) + 7)/8 + 3) & -4;
int nch = color ? 3 : 1;
+7
View File
@@ -81,6 +81,13 @@ ExrDecoder::ExrDecoder()
m_signature = "\x76\x2f\x31\x01";
m_file = 0;
m_red = m_green = m_blue = 0;
m_type = ((Imf::PixelType)0);
m_iscolor = false;
m_bit_depth = 0;
m_isfloat = false;
m_ischroma = false;
m_native_depth = false;
}
+1 -1
View File
@@ -341,7 +341,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
JHUFF_TBL **hufftbl;
unsigned char bits[17];
unsigned char huffval[256];
unsigned char huffval[256] = {0};
while (length > 16)
{
+3
View File
@@ -324,6 +324,9 @@ PAMDecoder::PAMDecoder()
m_buf_supported = true;
bit_mode = false;
selected_fmt = CV_IMWRITE_PAM_FORMAT_NULL;
m_maxval = 0;
m_channels = 0;
m_sampledepth = 0;
}
+1
View File
@@ -91,6 +91,7 @@ PngDecoder::PngDecoder()
m_f = 0;
m_buf_supported = true;
m_buf_pos = 0;
m_bit_depth = 0;
}
+3
View File
@@ -94,6 +94,9 @@ PxMDecoder::PxMDecoder()
{
m_offset = -1;
m_buf_supported = true;
m_bpp = 0;
m_binary = false;
m_maxval = 0;
}
+5 -1
View File
@@ -54,6 +54,10 @@ SunRasterDecoder::SunRasterDecoder()
{
m_offset = -1;
m_signature = fmtSignSunRas;
m_bpp = 0;
m_encoding = RAS_STANDARD;
m_maptype = RMT_NONE;
m_maplength = 0;
}
@@ -157,7 +161,7 @@ bool SunRasterDecoder::readData( Mat& img )
int color = img.channels() > 1;
uchar* data = img.ptr();
int step = (int)img.step;
uchar gray_palette[256];
uchar gray_palette[256] = {0};
bool result = false;
int src_pitch = ((m_width*m_bpp + 7)/8 + 1) & -2;
int nch = color ? 3 : 1;
+1
View File
@@ -62,6 +62,7 @@ namespace cv
WebPDecoder::WebPDecoder()
{
m_buf_supported = true;
channels = 0;
}
WebPDecoder::~WebPDecoder() {}