[FFmpeg-soc] [soc]: r2578 - mlp/mlpdec.c

ramiro subversion at mplayerhq.hu
Thu Jun 26 19:33:28 CEST 2008


Author: ramiro
Date: Thu Jun 26 19:33:28 2008
New Revision: 2578

Log:
More checks to see if there is enough data.

Modified:
   mlp/mlpdec.c

Modified: mlp/mlpdec.c
==============================================================================
--- mlp/mlpdec.c	(original)
+++ mlp/mlpdec.c	Thu Jun 26 19:33:28 2008
@@ -1009,6 +1009,9 @@ static int read_access_unit(AVCodecConte
     for (substr = 0; substr < m->num_substreams; substr++) {
         int extraword_present, checkdata_present, end;
 
+        if (bytes_left < 2)
+            return -1;
+
         extraword_present = get_bits1(&gb);
         skip_bits1(&gb);
         checkdata_present = get_bits1(&gb);
@@ -1022,6 +1025,8 @@ static int read_access_unit(AVCodecConte
         bytes_left -= 2;
 
         if (extraword_present) {
+            if (bytes_left < 2)
+                return -1;
             skip_bits(&gb, 16);
             parity_bits ^= *buf++;
             parity_bits ^= *buf++;



More information about the FFmpeg-soc mailing list