[FFmpeg-cvslog] r18238 - trunk/libavcodec/mlpdec.c

ramiro subversion
Mon Mar 30 05:42:40 CEST 2009


Author: ramiro
Date: Mon Mar 30 05:42:40 2009
New Revision: 18238

Log:
mlpdec: Simplify substream length mismatch error.

Modified:
   trunk/libavcodec/mlpdec.c

Modified: trunk/libavcodec/mlpdec.c
==============================================================================
--- trunk/libavcodec/mlpdec.c	Mon Mar 30 05:37:19 2009	(r18237)
+++ trunk/libavcodec/mlpdec.c	Mon Mar 30 05:42:40 2009	(r18238)
@@ -1017,8 +1017,10 @@ static int read_access_unit(AVCodecConte
             if (read_block_data(m, &gb, substr) < 0)
                 return -1;
 
-        } while ((get_bits_count(&gb) < substream_data_len[substr] * 8)
-                 && get_bits1(&gb) == 0);
+            if (get_bits_count(&gb) >= substream_data_len[substr] * 8)
+                goto substream_length_mismatch;
+
+        } while (!get_bits1(&gb));
 
         skip_bits(&gb, (-get_bits_count(&gb)) & 15);
         if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32) {
@@ -1049,9 +1051,7 @@ static int read_access_unit(AVCodecConte
                 av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n"    , substr);
         }
         if (substream_data_len[substr] * 8 != get_bits_count(&gb)) {
-            av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n",
-                   substr);
-            return -1;
+            goto substream_length_mismatch;
         }
 
 next_substr:
@@ -1065,6 +1065,10 @@ next_substr:
 
     return length;
 
+substream_length_mismatch:
+    av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", substr);
+    return -1;
+
 error:
     m->params_valid = 0;
     return -1;



More information about the ffmpeg-cvslog mailing list