--- bitstream.c 2004/05/31 21:26:23 1.42.2.4 +++ bitstream.c 2004/10/12 21:06:33 1.42.2.6 @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: bitstream.c,v 1.42.2.4 2004/05/31 21:26:23 edgomez Exp $ + * $Id: bitstream.c,v 1.42.2.6 2004/10/12 21:06:33 edgomez Exp $ * ****************************************************************************/ @@ -71,8 +71,10 @@ matrix[scan_tables[0][i++]] = value; } while (value != 0 && i < 64); - i--; /* fix little bug at coeff not full */ + if (value != 0) return; + + i--; while (i < 64) { matrix[scan_tables[0][i++]] = last; } @@ -393,7 +395,7 @@ int32_t time_increment = 0; int resize = 0; - do { + while ((BitstreamPos(bs) >> 3) + 4 <= bs->length) { BitstreamByteAlign(bs); start_code = BitstreamShowBits(bs, 32); @@ -1035,7 +1037,6 @@ BitstreamSkip(bs, 8); } } - while ((BitstreamPos(bs) >> 3) < bs->length); #if 0 DPRINTF("*** WARNING: no vop_start_code found");