[trunk] Make sure to exit early instead of looping on every single pixels
This commit is contained in:
parent
5a70e97f51
commit
18c5be69e9
|
@ -1867,8 +1867,12 @@ opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters) {
|
||||||
{
|
{
|
||||||
for(compno = 0; compno < numcomps; compno++)
|
for(compno = 0; compno < numcomps; compno++)
|
||||||
{
|
{
|
||||||
if ( !fread(&c0, 1, 1, fp) )
|
if ( !fread(&c0, 1, 1, fp) )
|
||||||
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
|
{
|
||||||
|
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
|
||||||
|
opj_image_destroy(image);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if(one)
|
if(one)
|
||||||
{
|
{
|
||||||
image->comps[compno].data[i] = c0;
|
image->comps[compno].data[i] = c0;
|
||||||
|
|
Loading…
Reference in New Issue