Author: ramiro
Date: Wed Jun 25 03:01:08 2008
New Revision: 2572

Log:
Decrement bytes_left as soon as data is read.

Modified:
   mlp/mlpdec.c

Modified: mlp/mlpdec.c
==============================================================================
--- mlp/mlpdec.c        (original)
+++ mlp/mlpdec.c        Wed Jun 25 03:01:08 2008
@@ -994,6 +994,7 @@ static int read_access_unit(AVCodecConte
         if (read_major_sync(m, &gb) < 0)
             goto error;
         header_size += 28;
+        bytes_left -= 28;
         buf += 28;
     }
 
@@ -1018,12 +1019,14 @@ static int read_access_unit(AVCodecConte
         parity_bits ^= *buf++;
         parity_bits ^= *buf++;
         header_size += 2;
+        bytes_left -= 2;
 
         if (extraword_present) {
             skip_bits(&gb, 16);
             parity_bits ^= *buf++;
             parity_bits ^= *buf++;
             header_size += 2;
+            bytes_left -= 2;
         }
 
         if (end + header_size > length) {
@@ -1054,8 +1057,6 @@ static int read_access_unit(AVCodecConte
         goto error;
     }
 
-    bytes_left -= get_bits_count(&gb) >> 3;
-
     for (substr = 0; substr <= m->max_decoded_substream; substr++) {
         init_get_bits(&gb, buf, substream_data_len[substr] * 8);
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to