Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues reported by Coverity Scan #846

Merged
merged 3 commits into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/openjpip/j2kheader_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ CODmarker_param_t get_CODmkrdata_from_j2kstream( Byte_t *CODstream)

if( *CODstream++ != 0xff || *CODstream++ != 0x52){
fprintf( FCGI_stderr, "Error, COD marker not found in the reconstructed j2kstream\n");
memset(&COD, 0, sizeof(COD));
return COD;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/test_tile_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int main (int argc, char *argv[])
int da_y0=0;
int da_x1=1000;
int da_y1=1000;
char input_file[64];
const char *input_file;

/* should be test_tile_decoder 0 0 1000 1000 tte1.j2k */
if( argc == 6 )
Expand All @@ -187,7 +187,7 @@ int main (int argc, char *argv[])
da_y0=atoi(argv[2]);
da_x1=atoi(argv[3]);
da_y1=atoi(argv[4]);
strcpy(input_file,argv[5]);
input_file = argv[5];

}
else
Expand All @@ -196,7 +196,7 @@ int main (int argc, char *argv[])
da_y0=0;
da_x1=1000;
da_y1=1000;
strcpy(input_file,"test.j2k");
input_file = "test.j2k";
}

if (! l_data) {
Expand Down
10 changes: 5 additions & 5 deletions tests/test_tile_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int main (int argc, char *argv[])
opj_stream_t * l_stream;
OPJ_UINT32 l_nb_tiles;
OPJ_UINT32 l_data_size;
unsigned char len;
size_t len;

#ifdef USING_MCT
const OPJ_FLOAT32 l_mct [] =
Expand All @@ -96,7 +96,7 @@ int main (int argc, char *argv[])
int tile_height;
int comp_prec;
int irreversible;
char output_file[64];
const char *output_file;

/* should be test_tile_encoder 3 2000 2000 1000 1000 8 tte1.j2k */
if( argc == 9 )
Expand All @@ -108,7 +108,7 @@ int main (int argc, char *argv[])
tile_height = atoi( argv[5] );
comp_prec = atoi( argv[6] );
irreversible = atoi( argv[7] );
strcpy(output_file, argv[8] );
output_file = argv[8];
}
else
{
Expand All @@ -119,7 +119,7 @@ int main (int argc, char *argv[])
tile_height = 1000;
comp_prec = 8;
irreversible = 1;
strcpy(output_file, "test.j2k" );
output_file = "test.j2k";
}
if( num_comps > NUM_COMPS_MAX )
{
Expand Down Expand Up @@ -228,7 +228,7 @@ int main (int argc, char *argv[])
}

/* should we do j2k or jp2 ?*/
len = (unsigned char)strlen( output_file );
len = strlen( output_file );
if( strcmp( output_file + len - 4, ".jp2" ) == 0 )
{
l_codec = opj_create_compress(OPJ_CODEC_JP2);
Expand Down