[MPlayer-dev-eng] [PATCH] libdvdcss: fix uninitialized disk key

Kirill Belokurov kirill.belokurov at gmail.com
Fri Mar 21 13:57:05 CET 2008


Hi!

This was originally the patch to libdvdcss-dev from 2007-09-25, but it looks 
like that maillist is almost dead, so I decided to propose it here (seeing 
that mplayer has a local libdvdcss copy). Below is the descripiton of the 
patch (applies with -2 lines fuzz):

==============================================
Under certain conditions, the array "dvdcss->css.p_disc_key" may remain
uninitialized till the line  (libdvdcss.c:492)

sprintf( &psz_key[1+i*2], "%.2x", dvdcss->css.p_disc_key[i] );

which will cause the "CSS keys cache folder" name for the DVD to be generated 
using raw memory contents. This will lead to a bug when libdvdcss often will 
not see the folder with previously cached keys and on the next DVD open 
attempt will retry the brute-force keys retrieval.

The attached patch fixes this for two different cases:

libdvdcss.c: for the case when DVD is encrypted but no ioctl is available
(which is usual for encrypted DVDs copied via dd /dev/cdrom /path/to/file )

css.c: for the case when key decryption fails, the fallback is done, but disk
key is not zeroed
==============================================

Regards,
Kirill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-uninitialized-disk-key.diff
Type: text/x-diff
Size: 827 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080321/39b095ca/attachment.diff>


More information about the MPlayer-dev-eng mailing list