[libbluray-devel] Improve resilence for corrupted blocks

hpi1 git at videolan.org
Wed Apr 15 10:22:27 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr 15 11:14:59 2015 +0300| [1fa831ecdeaa78b2204ae85cd028be3ca6b2fbdc] | committer: hpi1

Improve resilence for corrupted blocks

If TP header indicates AACS, first sync byte should be plain.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1fa831ecdeaa78b2204ae85cd028be3ca6b2fbdc
---

 src/libbluray/bluray.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index d1f3ee4..58c9922 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -603,8 +603,8 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
 
                 /* Check TP_extra_header Copy_permission_indicator. If != 0, unit is still encrypted. */
                 if (buf[0] & 0xc0) {
-                    /* check first TS sync bytes */
-                    if (buf[4] != 0x47 || buf[4+192] != 0x47 || buf[4+2*192] != 0x47) {
+                    /* check first TS sync bytes. First 16 bytes are always plain. */
+                    if (buf[4] == 0x47 && (buf[4+192] != 0x47 || buf[4+2*192] != 0x47)) {
                         BD_DEBUG(DBG_BLURAY | DBG_CRIT,
                                  "TP header copy permission indicator != 0, unit is still encrypted?\n");
                         _queue_event(bd, BD_EVENT_ENCRYPTED, BD_ERROR_AACS);



More information about the libbluray-devel mailing list