[libdvdnav-devel] Initialize dvd_reader_t struct in DVDOpenImageFile

Richard Hulme git at videolan.org
Sun Mar 2 12:02:34 CET 2014


libdvdread | branch: master | Richard Hulme <peper03 at yahoo.com> | Sun Jan 26 17:13:03 2014 +0100| [7c743650d038ee280f990cfb7d5f867842ee7369] | committer: Jean-Baptiste Kempf

Initialize dvd_reader_t struct in DVDOpenImageFile

This ensures that the dvd_reader_t struct is initialized (e.g. the css_state
field is currently undefined if 'have_css' is false).

The patch is part of a bigger MythTV-specific change by Chris Pinkham:
https://github.com/MythTV/mythtv/commit/3af3489

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/libdvdread.git/?a=commit;h=7c743650d038ee280f990cfb7d5f867842ee7369
---

 src/dvd_reader.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index 69c0011..bff5821 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -246,6 +246,7 @@ static dvd_reader_t *DVDOpenImageFile( const char *location, int have_css )
     dvdinput_close(dev);
     return NULL;
   }
+  memset( dvd, 0, sizeof( dvd_reader_t ) );
   dvd->isImageFile = 1;
   dvd->dev = dev;
   dvd->path_root = NULL;



More information about the libdvdnav-devel mailing list