diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-03-23 21:47:31 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-03-23 21:47:31 +0000 |
commit | 28f03eec2826b61adc58e545a642d3d14163cf91 (patch) | |
tree | 06b726841800ad61bcd6b157cae9922bc2f0f25a /src | |
parent | 4d0e0a887efb69fcd9a21db83d169cf99de1892d (diff) | |
download | xine-lib-28f03eec2826b61adc58e545a642d3d14163cf91.tar.gz xine-lib-28f03eec2826b61adc58e545a642d3d14163cf91.tar.bz2 |
Fix closing the vcd device if the disc is not a video CD.
libvcdinfo 0.7.23 closes the device in this case whereas the built-in version
did not, and this was causing double frees due to my previous fix which
addressed only the built-in version (which needs to be either updated to 0.7.23
or dropped).
CVS patchset: 8743
CVS date: 2007/03/23 21:47:31
Diffstat (limited to 'src')
-rw-r--r-- | src/input/vcd/libvcd/info.c | 16 | ||||
-rw-r--r-- | src/input/vcd/vcdio.c | 5 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/input/vcd/libvcd/info.c b/src/input/vcd/libvcd/info.c index d178968a8..b01bd6eee 100644 --- a/src/input/vcd/libvcd/info.c +++ b/src/input/vcd/libvcd/info.c @@ -1,5 +1,5 @@ /* - $Id: info.c,v 1.7 2006/09/26 22:29:39 dgp85 Exp $ + $Id: info.c,v 1.8 2007/03/23 21:47:31 dsalt Exp $ Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> @@ -59,7 +59,7 @@ #include <stddef.h> #include <errno.h> -static const char _rcsid[] = "$Id: info.c,v 1.7 2006/09/26 22:29:39 dgp85 Exp $"; +static const char _rcsid[] = "$Id: info.c,v 1.8 2007/03/23 21:47:31 dsalt Exp $"; #define BUF_COUNT 16 #define BUF_SIZE 80 @@ -1904,14 +1904,12 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[], strlen (ISO_XA_MARKER_STRING)); } - if (!read_info(obj->img, &(obj->info), &(obj->vcd_type))) - return VCDINFO_OPEN_OTHER; - - if (vcdinfo_get_format_version (obj) == VCD_TYPE_INVALID) - return VCDINFO_OPEN_OTHER; - - if (!read_entries(obj->img, &(obj->entries))) + if (!read_info(obj->img, &(obj->info), &(obj->vcd_type)) || + vcdinfo_get_format_version (obj) == VCD_TYPE_INVALID || + !read_entries(obj->img, &(obj->entries))) { + free (obj); /* match 0.7.23's behaviour */ return VCDINFO_OPEN_OTHER; + } { size_t len = strlen(*source_name)+1; diff --git a/src/input/vcd/vcdio.c b/src/input/vcd/vcdio.c index 31cc0cd49..387397cf4 100644 --- a/src/input/vcd/vcdio.c +++ b/src/input/vcd/vcdio.c @@ -1,5 +1,5 @@ /* - $Id: vcdio.c,v 1.8 2006/12/13 19:14:19 dsalt Exp $ + $Id: vcdio.c,v 1.9 2007/03/23 21:47:31 dsalt Exp $ Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> @@ -115,8 +115,7 @@ vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device) break; default: - /* Opened the device, but it's not a VCD => close it & return failure */ - vcdinfo_close(p_vcdplayer->vcd); + /* Opened the device, but it's not a VCD => is closed, return failure */ return false; } |