[v1.4] Fixed pi.c bug (issue 15 on google code). Thanks to Anton Lionel for catching...
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 8 Apr 2010 18:43:03 +0000 (18:43 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 8 Apr 2010 18:43:03 +0000 (18:43 +0000)
ChangeLog
jp3d/codec/jp3d_to_volume.c
libopenjpeg/pi.c

index b9670842ac2a58ca03cbae048a9f9f24deb55b04..4e6c156fe79cb27f915a2622080c7e8db8f1567a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ What's New for OpenJPEG
 + : added
 
 April 8, 2010
+* [FOD] Fixed pi.c bug (issue 15 on google code). Thanks to Anton Lionel for catching this.
 * [FOD] Fixed MJ2 codec bugs (issues 23-24 on google code). Thanks to Winfried for these patches
 * [FOD] Fixed JP3D codec file format analyzer. Thanks to Krist�f Ralovich for this patch.
 ! [FOD] Significant optimizations of MCT, DWT, MQ and T1 modules by Peter Wimmer (thanks Peter)
index a5614d713ed9f65ed4e279b8baf02c6cbc439f0e..b5c757567031e5d6d012b827454757960a0eec2a 100755 (executable)
@@ -205,6 +205,8 @@ int get_file_format(char *filename) {
                        }\r
                }\r
        }\r
+\r
+       return -1;\r
 }\r
 \r
 /* -------------------------------------------------------------------------- */\r
index ac7654c5f14f65e8d3a6ebe62cff7ede39b140b2..06e76af765f57370974c517cc2d3ae50f285d038 100644 (file)
@@ -209,14 +209,14 @@ if (!pi->tp_on){
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
                                        rpx = res->pdx + levelno;
                                        rpy = res->pdy + levelno;
-                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
+                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
                                                continue;       
                                        }
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
                                                continue; 
                                        }
                                        
-                                       if ((res->pw==0)||(res->pw==0)) continue;
+                                       if ((res->pw==0)||(res->ph==0)) continue;
                                        
                                        if ((trx0==trx1)||(try0==try1)) continue;
                                        
@@ -290,14 +290,14 @@ static bool pi_next_pcrl(opj_pi_iterator_t * pi) {
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
                                        rpx = res->pdx + levelno;
                                        rpy = res->pdy + levelno;
-                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
+                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
                                                continue;       
                                        }
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
                                                continue; 
                                        }
                                        
-                                       if ((res->pw==0)||(res->pw==0)) continue;
+                                       if ((res->pw==0)||(res->ph==0)) continue;
                                        
                                        if ((trx0==trx1)||(try0==try1)) continue;
                                        
@@ -369,14 +369,14 @@ static bool pi_next_cprl(opj_pi_iterator_t * pi) {
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
                                        rpx = res->pdx + levelno;
                                        rpy = res->pdy + levelno;
-                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
+                                       if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
                                                continue;       
                                        }
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
                                                continue; 
                                        }
                                        
-                                       if ((res->pw==0)||(res->pw==0)) continue;
+                                       if ((res->pw==0)||(res->ph==0)) continue;
                                        
                                        if ((trx0==trx1)||(try0==try1)) continue;