ref: a952619a3ea1d1924ca7e8605ce495f0d121a167
parent: 5cfc298514b652c1fa3753f7fd7fb7bd70da05a1
author: menno <menno>
date: Tue Jun 5 14:38:57 EDT 2007
hcr.c: Removed some code that caused false errors. bits.h: Fixed a potential bug, although code is never used probably.
--- a/libfaad/bits.h
+++ b/libfaad/bits.h
@@ -27,7 +27,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
**
-** $Id: bits.h,v 1.42 2006/05/07 18:09:00 menno Exp $
+** $Id: bits.h,v 1.43 2007/06/05 18:38:57 menno Exp $
**/
#ifndef __BITS_H__
@@ -256,11 +256,15 @@
ld->start--;
ld->bits_left += (32 - bits);
- ld->bytes_left -= 4;
+ if (ld->bytes_left < 4)
+ {
+ ld->error = 1;
+ ld->bytes_left = 0;
+ } else {
+ ld->bytes_left -= 4;
+ }
// if (ld->bytes_left == 0)
// ld->no_more_reading = 1;
- if (ld->bytes_left < 0)
- ld->error = 1;
}
}
--- a/libfaad/hcr.c
+++ b/libfaad/hcr.c
@@ -27,7 +27,7 @@
** Commercial non-GPL licensing of this software is possible.
** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
**
-** $Id: hcr.c,v 1.21 2006/07/22 14:13:21 menno Exp $
+** $Id: hcr.c,v 1.22 2007/06/05 18:38:57 menno Exp $
**/
#include "common.h"
@@ -410,6 +410,7 @@
rewrev_bits(&segment[i]);
}
+#if 0 // Seems to give false errors
bitsleft = 0;
for (i = 0; i < numberOfSegments && !bitsleft; i++)
@@ -422,8 +423,10 @@
for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++)
if (!codeword[i].decoded)
codewordsleft++;
-
+
if (codewordsleft) return 10;
+#endif
+
return 0;