[svn] / branches / release-1_1-branch / xvidcore / src / bitstream / mbcoding.c Repository:
ViewVC logotype

Diff of /branches/release-1_1-branch/xvidcore/src/bitstream/mbcoding.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1654, Tue Nov 22 10:23:02 2005 UTC revision 1776, Wed Jun 27 18:57:42 2007 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: mbcoding.c,v 1.52 2005-09-13 12:12:15 suxen_drol Exp $   * $Id: mbcoding.c,v 1.52.2.1 2007-06-27 18:57:42 Isibaar Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 1067  Line 1067 
1067    
1068          do {          do {
1069                  level = get_coeff(bs, &run, &last, 1, 0);                  level = get_coeff(bs, &run, &last, 1, 0);
1070                  if (run == -1) {                  coeff += run;
1071                          DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");                  if ((run|coeff)&~63) {
1072                            DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1073                          break;                          break;
1074                  }                  }
                 coeff += run;  
   
 #ifdef _DEBUG  
                 if(coeff>=64) {  
                   DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");  
                   return;  
                 }  
 #endif  
1075    
1076                  block[scan[coeff]] = level;                  block[scan[coeff]] = level;
1077    
# Line 1115  Line 1108 
1108          p = 0;          p = 0;
1109          do {          do {
1110                  level = get_coeff(bs, &run, &last, 0, 0);                  level = get_coeff(bs, &run, &last, 0, 0);
                 if (run == -1) {  
                         DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");  
                         break;  
                 }  
1111                  p += run;                  p += run;
1112                    if ((run|p)&~63) {
1113  #ifdef _DEBUG                          DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1114                  if(p>=64)       {                          break;
                   DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");  
                   return;  
1115                  }                  }
 #endif  
1116    
1117                  if (level < 0) {                  if (level < 0) {
1118                          level = level*quant_m_2 - quant_add;                          level = level*quant_m_2 - quant_add;
# Line 1157  Line 1143 
1143          p = 0;          p = 0;
1144          do {          do {
1145                  level = get_coeff(bs, &run, &last, 0, 0);                  level = get_coeff(bs, &run, &last, 0, 0);
                 if (run == -1) {  
                         DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");  
                         break;  
                 }  
1146                  p += run;                  p += run;
1147                    if ((run|p)&~63) {
1148  #ifdef _DEBUG                          DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1149                  if(p>=64)       {                          break;
                   DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");  
                   return;  
1150                  }                  }
 #endif  
1151    
1152                  if (level < 0) {                  if (level < 0) {
1153                          level = ((2 * -level + 1) * matrix[scan[p]] * quant) >> 4;                          level = ((2 * -level + 1) * matrix[scan[p]] * quant) >> 4;

Legend:
Removed from v.1654  
changed lines
  Added in v.1776

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4