[iso] update libcdio to v0.93

* Also fix a memory leak introduced vy v0.93 in cdio_free()
This commit is contained in:
Pete Batard 2014-10-31 18:52:23 +00:00
parent 7090a0371a
commit ea817cbc2c
29 changed files with 305 additions and 164 deletions

View File

@ -1,5 +1,6 @@
/* -*- c -*-
Copyright (C) 2003, 2004, 2005, 2008, 2009 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003, 2004, 2005, 2008, 2009, 2014
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify
@ -45,8 +46,6 @@ extern "C" {
/** This is an opaque structure for the CD object. */
typedef struct _CdIo CdIo_t;
typedef struct cdtext_s cdtext_t;
#ifdef __cplusplus
}
#endif /* __cplusplus */
@ -70,4 +69,7 @@ extern "C" {
/* Track-related functions. */
#include <cdio/track.h>
/* Memory management functions. */
#include <cdio/memory.h>
#endif /* __CDIO_H__ */

View File

@ -1 +1,2 @@
/* Empty placeholder */
/* Placeholder */
typedef struct cdtext_s cdtext_t;

View File

@ -1,7 +1,7 @@
/* -*- c -*-
Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012 Rocky Bernstein
<rocky@gnu.org>
Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014
Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -61,9 +61,9 @@ extern "C" {
Get binary CD-Text information for a CdIo_t object.
@param p_cdio the CD object that may contain CD-Text information.
@return malloc'd pointer to raw CD-Text data as stored on the disc
or NULL if p_cdio is NULL or CD-Text information does not exist.
Return value should be freed when done with it and not NULL.
@return malloc'd pointer to raw CD-Text data as stored on the disc or
NULL if p_cdio is NULL or CD-Text information does not exist. Return
value must be freed with cdio_free() when done with it and not NULL.
*/
uint8_t * cdio_get_cdtext_raw (CdIo_t *p_cdio);
@ -101,8 +101,8 @@ extern "C" {
@return the media catalog number or NULL if there is none or we
don't have the ability to get it.
Note: string is malloc'd so caller has to free() the returned
string when done with it.
Note: The caller must free the returned string with cdio_free()
when done with it.
*/
char * cdio_get_mcn (const CdIo_t *p_cdio);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012
Copyright (C) 2003-2008, 2012-2013
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@ -859,7 +859,7 @@ iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len);
lsn and return information about it.
@return stat_t of entry if we found lsn, or NULL otherwise.
Caller must free return value.
Caller must free return value using iso9660_stat_free().
*/
#define iso9660_fs_find_lsn iso9660_find_fs_lsn
iso9660_stat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn);
@ -870,7 +870,7 @@ iso9660_stat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn);
lsn and return information about it.
@return stat_t of entry if we found lsn, or NULL otherwise.
Caller must free return value.
Caller must free return value using iso9660_stat_free().
*/
iso9660_stat_t *iso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn,
/*out*/ char **ppsz_path);
@ -880,7 +880,7 @@ iso9660_stat_t *iso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn,
lsn and return information about it.
@return stat_t of entry if we found lsn, or NULL otherwise.
Caller must free return value.
Caller must free return value using iso9660_stat_free().
*/
iso9660_stat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn);
@ -897,12 +897,16 @@ iso9660_stat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn);
*ppsz_path when you are done using it.
@return stat_t of entry if we found lsn, or NULL otherwise.
Caller must free return value.
Caller must free return value using iso9660_stat_free().
*/
iso9660_stat_t *iso9660_ifs_find_lsn_with_path(iso9660_t *p_iso,
lsn_t i_lsn,
/*out*/ char **ppsz_path);
/*!
Free the passed iso9660_stat_t structure.
*/
void iso9660_stat_free(iso9660_stat_t *p_stat);
/*!
Return file status for psz_path. NULL is returned on error.
@ -951,7 +955,7 @@ iso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso,
/*! Read psz_path (a directory) and return a list of iso9660_stat_t
pointers for the files inside that directory. The caller must free the
returned result.
returned result using _cdio_list_free().
b_mode2 is historical. It is not used.
*/
@ -960,7 +964,7 @@ CdioList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[],
/*! Read psz_path (a directory) and return a list of iso9660_stat_t
pointers for the files inside that directory. The caller must free
the returned result.
the returned result using _cdio_list_free().
*/
CdioList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]);

View File

@ -97,11 +97,7 @@ cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);
*/
void cdio_log (cdio_log_level_t level,
const char format[], ...) GNUC_PRINTF(2, 3);
#if defined(__GNUC__)
/* See http://clang-analyzer.llvm.org/annotations.html#custom_assertions */
void cdio_assert_log (const char format[], ...)
GNUC_PRINTF(1, 2) __attribute__((__noreturn__));
#endif
/**
* Handle a debugging message.
*

41
src/libcdio/cdio/memory.h Normal file
View File

@ -0,0 +1,41 @@
/*
Copyright (C) 2014 Robert Kausch <robert.kausch@freac.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file memory.h
*
* \brief memory management utility functions.
*
*/
#ifndef CDIO_MEMORY_H_
#define CDIO_MEMORY_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*!
Free the passed pointer.
*/
void cdio_free(void *p_memory);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CDIO_MEMORY_H_ */

View File

@ -211,8 +211,8 @@ extern "C" {
@return the International Standard Recording Code (ISRC) or NULL
if there is none or we don't have the ability to get it.
Note: string is malloc'd so caller has to free() the returned
string when done with it.
Note: The caller must free the returned string with cdio_free()
when done with it.
*/
char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2008, 2012 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2008, 2012, 2014 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2006 Burkhard Plaum <plaum@ipf.uni-stuttgart.de>
This program is free software: you can redistribute it and/or modify
@ -52,7 +52,7 @@ void cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv);
* \param dst_len If non NULL, returns the length of the destination string
* \returns true if conversion was sucessful, false else.
*
* The destination string must be freed by the caller with free().
* The destination string must be freed by the caller with cdio_free().
* If you pass -1 for src_len, strlen() will be used.
*/
@ -69,6 +69,8 @@ bool cdio_charset_convert(cdio_charset_coverter_t*cnv,
*
* This is a convenience function, which creates a charset converter,
* converts one string and destroys the charset converter.
*
* The destination string must be freed by the caller with cdio_free().
*/
@ -83,8 +85,10 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
* \returns true if conversion was sucessful, false else.
*
* This is a convenience function, which creates a charset converter,
* converts one string and destroys the charset converter. If you pass -1
* for src_len, strlen() will be used.
* converts one string and destroys the charset converter.
*
* The destination string must be freed by the caller with cdio_free().
* If you pass -1 for src_len, strlen() will be used.
*/
@ -95,7 +99,7 @@ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,
/** \brief Convert an UTF8 string to UTF-16 (allocate returned string)
* \param str Source string
* \returns NULL if the conversion was unsuccesful. Caller must free the
* returned string.
* returned string with cdio_free().
* This is a convenience function available on Windows platforms only.
*/
wchar_t* cdio_utf8_to_wchar(const char* str);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012
Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@ -101,7 +101,8 @@ _cdio_strdup_upper (const char str[]);
/* Duplicate path and make it platform compliant. Typically needed for
MinGW/MSYS where a "/c/..." path must be translated to "c:/..." for
use with fopen(), etc. Returned string must be freed by the caller. */
use with fopen(), etc. Returned string must be freed by the caller
using cdio_free(). */
char *
_cdio_strdup_fixpath (const char path[]);

View File

@ -8,13 +8,13 @@
/*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what
version is used. cdio_version_string has the same value, but it is a
constant variable that can be accessed at run time. */
#define CDIO_VERSION "0.90 i686-pc-mingw32"
#define CDIO_VERSION "0.93 i686-pc-mingw32"
extern const char *cdio_version_string; /**< = CDIO_VERSION */
/*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for
testing in the C preprocessor. libcdio_version_num has the same
value, but it is a constant variable that can be accessed at run
time. */
#define LIBCDIO_VERSION_NUM 90
#define LIBCDIO_VERSION_NUM 93
extern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */

View File

@ -146,7 +146,7 @@ iso9660_get_xa_attr_str (uint16_t xa_attr);
/*!
Allocates and initalizes a new iso9600_xa_t variable and returns
it. The caller should free the returned result.
it. The caller must free the returned result using iso9660_xa_free().
@see iso9660_xa
*/
@ -154,6 +154,14 @@ iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum);
/*!
Frees the passed iso9600_xa_t structure.
@see iso9660_xa
*/
void
iso9660_xa_free (iso9660_xa_t *_xa);
#ifdef __cplusplus
}

View File

@ -22,6 +22,7 @@
<ClCompile Include="..\disc.c" />
<ClCompile Include="..\ds.c" />
<ClCompile Include="..\logging.c" />
<ClCompile Include="..\memory.c" />
<ClCompile Include="..\read.c" />
<ClCompile Include="..\sector.c" />
<ClCompile Include="..\track.c" />
@ -34,6 +35,7 @@
<ClInclude Include="..\..\cdio\cdio.h" />
<ClInclude Include="..\..\cdio\ds.h" />
<ClInclude Include="..\..\cdio\logging.h" />
<ClInclude Include="..\..\cdio\memory.h" />
<ClInclude Include="..\..\cdio\sector.h" />
<ClInclude Include="..\..\cdio\types.h" />
<ClInclude Include="..\..\cdio\util.h" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
@ -41,6 +41,9 @@
<ClCompile Include="..\utf8.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\memory.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\_cdio_stdio.h">
@ -85,5 +88,8 @@
<ClInclude Include="..\..\cdio\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\cdio\memory.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -73,7 +73,7 @@ static inline int _stati64_utf8(const char *path, struct _stati64 *buffer) {
int ret;
wchar_t* wpath = cdio_utf8_to_wchar(path);
ret = _wstati64(wpath, buffer);
free(wpath);
cdio_free(wpath);
return ret;
}
#define CDIO_STAT_CALL _stati64_utf8
@ -262,7 +262,7 @@ cdio_stdio_new(const char pathname[])
{
cdio_warn ("could not retrieve file info for `%s': %s",
pathdup, strerror (errno));
free(pathdup);
cdio_free(pathdup);
return NULL;
}

View File

@ -35,8 +35,19 @@
extern "C" {
#endif /* __cplusplus */
extern const char * cdio_dirname(const char *fname);
extern const char *cdio_abspath(const char *cwd, const char *fname);
/*!
Get directory name from file name.
Callers must free return value after use.
*/
extern char *cdio_dirname(const char *fname);
/*!
Construct an absolute file name from path and file name.
Callers must free return value after use.
*/
extern char *cdio_abspath(const char *cwd, const char *fname);
/* Opaque type */
typedef struct _CdioDataSource CdioDataSource_t;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012
Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012, 2014
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@ -77,8 +77,8 @@ cdio_get_cdtext (CdIo *obj)
@param obj the CD object that may contain CD-TEXT information.
@return pointer to allocated memory area holding the raw CD-TEXT
or NULL if obj is NULL or CD-TEXT does not exist.
free() when done.
or NULL if obj is NULL or CD-TEXT does not exist. Return value
must be freed with cdio_free() when done with it and not NULL.
*/
uint8_t *
cdio_get_cdtext_raw (CdIo *obj)

View File

@ -0,0 +1,42 @@
/*
Copyright (C) 2014 Robert Kausch <robert.kausch@freac.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <cdio/memory.h>
#include <cdio/types.h>
/*!
Free the passed pointer.
@param p_memory a pointer to memory allocated by a libcdio funtion.
*/
void
cdio_free (void *p_memory)
{
if (p_memory == NULL) return;
free(p_memory);
}

View File

@ -1,10 +1,10 @@
/*
Copyright (C) 2004, 2005, 2011, 2012 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2004, 2005, 2011, 2012, 2014 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@ -13,8 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
@ -81,9 +80,9 @@ cdio_lsn_to_msf (lsn_t lsn, msf_t *msf)
f = lsn + CDIO_CD_MAX_LSN;
}
if (m > 6) {
if (m > 99) {
cdio_warn ("number of minutes (%d) truncated to 99.", m);
m = 6;
m = 99;
}
msf->m = cdio_to_bcd8 (m);

View File

@ -294,8 +294,8 @@ cdio_get_track_lsn(const CdIo_t *p_cdio, track_t u_track)
Return the International Standard Recording Code (ISRC) for track number
u_track in p_cdio. Track numbers start at 1.
Note: string is malloc'd so caller has to free() the returned
string when done with it.
Note: The caller must free the returned string with cdio_free()
when done with it.
*/
char *
cdio_get_track_isrc (const CdIo_t *p_cdio, track_t u_track)

View File

@ -1,6 +1,6 @@
/*
Copyright (C) 2006, 2008 Burkhard Plaum <plaum@ipf.uni-stuttgart.de>
Copyright (C) 2011 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2011, 2014 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2012 Pete Batard <pete@akeo.ie>
This program is free software: you can redistribute it and/or modify
@ -41,6 +41,7 @@
#include <cdio/utf8.h>
#include <cdio/logging.h>
#include <cdio/memory.h>
/* Windows requires some basic UTF-8 support outside of Joliet */
#if defined(_WIN32)
@ -107,8 +108,8 @@ FILE* fopen_utf8(const char* filename, const char* mode)
wchar_t* wfilename = cdio_utf8_to_wchar(filename);
wchar_t* wmode = cdio_utf8_to_wchar(mode);
ret = _wfopen(wfilename, wmode);
free(wfilename);
free(wmode);
cdio_free(wfilename);
cdio_free(wmode);
return ret;
}
#endif
@ -292,7 +293,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
/* Eliminate empty strings */
le_dst = cdio_utf8_to_wchar(src);
if ((le_dst == NULL) || (le_dst[0] == 0)) {
free(le_dst);
cdio_free(le_dst);
return false;
}

View File

@ -139,7 +139,8 @@ _cdio_strdup_upper (const char str[])
}
/* Convert MinGW/MSYS paths that start in "/c/..." to "c:/..."
so that they can be used with fopen(), stat(), etc. */
so that they can be used with fopen(), stat(), etc.
Returned string must be freed by the caller using cdio_free().*/
char *
_cdio_strdup_fixpath (const char path[])
{

View File

@ -21,6 +21,7 @@
<ItemGroup>
<ClInclude Include="..\..\cdio\bytesex.h" />
<ClInclude Include="..\..\cdio\cdio.h" />
<ClInclude Include="..\..\cdio\cdtext.h" />
<ClInclude Include="..\..\cdio\iso9660.h" />
<ClInclude Include="..\..\cdio\logging.h" />
<ClInclude Include="..\..\cdio\utf8.h" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
@ -47,6 +47,9 @@
<ClInclude Include="..\..\driver\filemode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\cdio\cdtext.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\iso9660_fs.c">

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2003-2009, 2013 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003-2009, 2013-2014 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify
@ -360,7 +360,7 @@ iso9660_set_ltime_with_timezone(const struct tm *p_tm,
{
char *_pvd_date = (char *) pvd_date;
memset (_pvd_date, '0', 16);
memset (_pvd_date, (int) '0', 16);
pvd_date->lt_gmtoff = (iso712_t) 0; /* Start out with time zone GMT. */
if (!p_tm) return;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2003-2008, 2011-2013 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003-2008, 2011-2014 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify
@ -754,6 +754,7 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, bool_3way_t b_xa,
if (!p_stat_new)
{
cdio_warn("Couldn't calloc(1, %d)", (int)(sizeof(iso9660_stat_t)+i_rr_fname+2));
free(p_stat);
return NULL;
}
memcpy(p_stat_new, p_stat, stat_len);
@ -1270,12 +1271,15 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[], bool b_mode2)
if (!_dirbuf)
{
cdio_warn("Couldn't calloc(1, %d)", p_stat->secsize * ISO_BLOCKSIZE);
_cdio_list_free (retval, true);
return NULL;
}
if (cdio_read_data_sectors (p_cdio, _dirbuf, p_stat->lsn,
ISO_BLOCKSIZE, p_stat->secsize))
ISO_BLOCKSIZE, p_stat->secsize)) {
_cdio_list_free (retval, true);
return NULL;
}
while (offset < (p_stat->secsize * ISO_BLOCKSIZE))
{
@ -1334,12 +1338,14 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[])
if (!_dirbuf)
{
cdio_warn("Couldn't calloc(1, %d)", p_stat->secsize * ISO_BLOCKSIZE);
_cdio_list_free (retval, true);
return NULL;
}
ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, p_stat->secsize);
if (ret != ISO_BLOCKSIZE*p_stat->secsize)
{
_cdio_list_free (retval, true);
free (_dirbuf);
return NULL;
}
@ -1415,6 +1421,7 @@ find_lsn_recurse (void *p_image, iso9660_readdir_t iso9660_readdir,
iso9660_stat_t *ret_stat = calloc(1, len2);
if (!ret_stat)
{
_cdio_list_free (dirlist, true);
cdio_warn("Couldn't calloc(1, %d)", len2);
return NULL;
}
@ -1510,6 +1517,16 @@ iso9660_ifs_find_lsn_with_path(iso9660_t *p_iso, lsn_t i_lsn,
"/", i_lsn, ppsz_full_filename);
}
/*!
Free the passed iso9660_stat_t structure.
*/
void
iso9660_stat_free(iso9660_stat_t *p_stat)
{
if (p_stat != NULL)
free(p_stat);
}
/*!
Return true if ISO 9660 image has extended attrributes (XA).
*/
@ -1563,11 +1580,11 @@ iso_have_rr_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root,
if ( have_rr != yep) {
have_rr = iso_have_rr_traverse (p_iso, p_stat, &splitpath[1], pu_file_limit);
}
free(p_stat);
if (have_rr != nope) {
free (_dirbuf);
return have_rr;
}
free(p_stat);
offset += iso9660_get_dir_len(p_iso9660_dir);
*pu_file_limit = (*pu_file_limit)-1;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2008, 2010, 2011 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2008, 2010-2011, 2014 Rocky Bernstein <rocky@gnu.org>
Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale
This program is free software: you can redistribute it and/or modify
@ -616,5 +616,3 @@ iso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr)
{
return (mode_t) rr->st_mode;
}

View File

@ -151,6 +151,13 @@ iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
return _xa;
}
void
iso9660_xa_free (iso9660_xa_t *_xa)
{
if (_xa != NULL)
free(_xa);
}
/*!
Returns POSIX mode bitstring for a given file.
*/

View File

@ -1,5 +1,6 @@
/*
Copyright (C) 2005-2006, 2008, 2011, 2013 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005-2006, 2008, 2011, 2013-2014
Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -205,10 +206,9 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe,
#define udf_PATH_DELIMITERS "/\\"
/* Searches p_udf_dirent a directory entry called psz_token.
Note p_udf_dirent is continuously updated. If the entry is
not found p_udf_dirent is useless and thus the caller should
not use it afterwards.
/* Searches p_udf_dirent for a directory entry called psz_token.
Note that p_udf_dirent may be replaced or freed during this call
and only the returned udf_dirent_t must be used afterwards.
*/
static
udf_dirent_t *
@ -221,20 +221,21 @@ udf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token)
if (!next_tok)
return p_udf_dirent; /* found */
else if (p_udf_dirent->b_dir) {
udf_dirent_t * p_udf_dirent2 = udf_opendir(p_udf_dirent);
udf_dirent_t * p_udf_dirent_next = udf_opendir(p_udf_dirent);
if (p_udf_dirent2) {
udf_dirent_t * p_udf_dirent3 =
udf_ff_traverse(p_udf_dirent2, next_tok);
if (p_udf_dirent_next) {
/* free p_udf_dirent to avoid leaking memory. */
udf_dirent_free(p_udf_dirent);
/* if p_udf_dirent3 is null p_udf_dirent2 is free'd. */
return p_udf_dirent3;
/* previous p_udf_dirent_next is freed by udf_ff_traverse. */
p_udf_dirent_next = udf_ff_traverse(p_udf_dirent_next, next_tok);
return p_udf_dirent_next;
}
}
}
}
if (p_udf_dirent)
free(p_udf_dirent->psz_name);
return NULL;
}
@ -253,20 +254,15 @@ udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name)
/* file position must be reset when accessing a new file */
p_udf_root->p_udf->i_position = 0;
strncpy(tokenline, psz_name, udf_MAX_PATHLEN);
tokenline[udf_MAX_PATHLEN-1] = '\0';
strncpy(tokenline, psz_name, udf_MAX_PATHLEN-1);
psz_token = strtok(tokenline, udf_PATH_DELIMITERS);
if (psz_token) {
/*** FIXME??? udf_dirent can be variable size due to the
extended attributes and descriptors. Given that, is this
correct?
*/
udf_dirent_t *p_udf_dirent =
udf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf,
p_udf_root->psz_name, p_udf_root->b_dir,
p_udf_root->b_parent);
p_udf_file = udf_ff_traverse(p_udf_dirent, psz_token);
if (p_udf_file != p_udf_dirent)
udf_dirent_free(p_udf_dirent);
}
else if ( 0 == strncmp("/", psz_name, sizeof("/")) ) {
return udf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf,
@ -299,7 +295,7 @@ unicode16_decode(const uint8_t *data, int i_len)
cdio_charset_to_utf8((char*)&data[1], i_len-1, &r, "UCS-2BE");
return r;
default:
/* Empty string, for calls that can't take a NULL pointer */
/* Empty string, as some existing sections can't take a NULL pointer */
r = (char*)calloc(1, 1);
return r;
}

View File

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 1.4.11.521"
CAPTION "Rufus 1.4.11.522"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 1.4.11.521"
CAPTION "Rufus 1.4.11.522"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -428,8 +428,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,11,521
PRODUCTVERSION 1,4,11,521
FILEVERSION 1,4,11,522
PRODUCTVERSION 1,4,11,522
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -446,13 +446,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.11.521"
VALUE "FileVersion", "1.4.11.522"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.4.11.521"
VALUE "ProductVersion", "1.4.11.522"
END
END
BLOCK "VarFileInfo"