ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvs/xvidcore/src/bitstream/mbcoding.c
(Generate patch)

Comparing xvidcore/src/bitstream/mbcoding.c (file contents):
Revision 1.54 by syskin, Sat Apr 28 16:30:20 2007 UTC vs.
Revision 1.55 by Isibaar, Wed Jun 27 14:38:05 2007 UTC

# Line 1091 | Line 1091 | get_intra_block(Bitstream * bs,
1091  
1092          do {
1093                  level = get_coeff(bs, &run, &last, 1, 0);
1094                if (run == -1) {
1095                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");
1096                        break;
1097                }
1094                  coeff += run;
1095 <                
1096 < #ifdef _DEBUG
1097 <                if(coeff>=64) {
1102 <                  DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");
1103 <                  return;
1095 >                if ((run|coeff)&~63) {
1096 >                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1097 >                        break;
1098                  }
1105 #endif
1099  
1100                  block[scan[coeff]] = level;
1101  
# Line 1139 | Line 1132 | get_inter_block_h263(
1132          p = 0;
1133          do {
1134                  level = get_coeff(bs, &run, &last, 0, 0);
1142                if (run == -1) {
1143                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");
1144                        break;
1145                }
1135                  p += run;
1136 <
1137 < #ifdef _DEBUG
1138 <                if(p>=64)       {
1150 <                  DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");
1151 <                  return;
1136 >                if ((p|run)&~63) {
1137 >                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1138 >                        break;
1139                  }
1153 #endif
1140  
1141                  if (level < 0) {
1142                          level = level*quant_m_2 - quant_add;
# Line 1181 | Line 1167 | get_inter_block_mpeg(
1167          p = 0;
1168          do {
1169                  level = get_coeff(bs, &run, &last, 0, 0);
1184                if (run == -1) {
1185                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run");
1186                        break;
1187                }
1170                  p += run;
1171 <
1172 < #ifdef _DEBUG
1173 <                if(p>=64)       {
1192 <                  DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n");
1193 <                  return;
1171 >                if ((p|run)&~63) {
1172 >                        DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index");
1173 >                        break;
1174                  }
1195 #endif
1175  
1176                  if (level < 0) {
1177                          level = ((2 * -level + 1) * matrix[scan[p]] * quant) >> 4;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines