Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
ba2dbc41
Commit
ba2dbc41
authored
Dec 19, 2001
by
Johan Bilien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a segfault in vcd input (thank you Sam)
parent
2d90188b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
24 deletions
+21
-24
plugins/vcd/input_vcd.c
plugins/vcd/input_vcd.c
+11
-14
plugins/vcd/linux_cdrom_tools.c
plugins/vcd/linux_cdrom_tools.c
+10
-10
No files found.
plugins/vcd/input_vcd.c
View file @
ba2dbc41
...
...
@@ -319,8 +319,8 @@ static void VCDInit( input_thread_t * p_input )
area
[
i
]
->
i_id
=
i
;
/* Absolute start offset and size */
area
[
i
]
->
i_start
=
p_vcd
->
tracks_sector
[
i
+
1
];
area
[
i
]
->
i_size
=
p_vcd
->
tracks_sector
[
i
+
2
]
-
p_vcd
->
tracks_sector
[
i
+
1
];
area
[
i
]
->
i_start
=
p_vcd
->
tracks_sector
[
i
];
area
[
i
]
->
i_size
=
p_vcd
->
tracks_sector
[
i
+
1
]
-
p_vcd
->
tracks_sector
[
i
];
/* Number of chapters */
area
[
i
]
->
i_part_nb
=
0
;
// will be the entry points
...
...
@@ -330,7 +330,7 @@ static void VCDInit( input_thread_t * p_input )
area
[
i
]
->
i_angle_nb
=
1
;
// no angle support in VCDs
area
[
i
]
->
i_angle
=
1
;
area
[
i
]
->
i_plugin_data
=
p_vcd
->
tracks_sector
[
i
+
1
];
area
[
i
]
->
i_plugin_data
=
p_vcd
->
tracks_sector
[
i
];
}
#undef area
...
...
@@ -338,7 +338,7 @@ static void VCDInit( input_thread_t * p_input )
i_title
=
main_GetIntVariable
(
INPUT_TITLE_VAR
,
1
);
if
(
i_title
<=
0
)
{
i_title
=
2
;
i_title
=
1
;
}
// p_vcd->current_track = i_title-1 ;
...
...
@@ -434,14 +434,14 @@ static int VCDSetArea( input_thread_t * p_input, input_area_t * p_area )
{
/* Reset the Chapter position of the old title */
p_input
->
stream
.
p_selected_area
->
i_part
=
0
;
p_input
->
stream
.
p_selected_area
->
i_tell
=
0
;
/* Change the default area */
p_input
->
stream
.
p_selected_area
=
p_input
->
stream
.
pp_areas
[
p_area
->
i_id
];
p_input
->
stream
.
p_selected_area
=
p_area
;
/* Change the current track */
/* The first track is not a valid one */
p_vcd
->
current_track
=
p_area
->
i_id
+
1
;
p_vcd
->
current_track
=
p_area
->
i_id
;
p_vcd
->
current_sector
=
p_vcd
->
tracks_sector
[
p_vcd
->
current_track
]
;
}
/* warn interface that something has changed */
...
...
@@ -616,9 +616,6 @@ static int VCDRead( input_thread_t * p_input,
}
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
...
...
@@ -635,8 +632,8 @@ static int VCDRead( input_thread_t * p_input,
}*/
b_eof
=
p_vcd
->
b_end_of_track
&&
(
(
p_vcd
->
current_track
+
1
)
>=
p_vcd
->
nb_tracks
);
b_eof
=
p_vcd
->
b_end_of_track
;
/*FIXME&& ( ( p_vcd->current_track ) >= p_vcd->nb_tracks - 1);*/
if
(
b_eof
)
{
...
...
@@ -647,9 +644,9 @@ static int VCDRead( input_thread_t * p_input,
if
(
p_vcd
->
b_end_of_track
)
{
intf_WarnMsg
(
4
,
"vcd info: new title"
);
p_vcd
->
current_track
++
;
p_vcd
->
b_end_of_track
=
0
;
VCDSetArea
(
p_input
,
p_input
->
stream
.
pp_areas
[
p_vcd
->
current_track
]
);
VCDSetArea
(
p_input
,
p_input
->
stream
.
pp_areas
[
p_input
->
stream
.
p_selected_area
->
i_id
+
1
]
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
return
0
;
}
...
...
plugins/vcd/linux_cdrom_tools.c
View file @
ba2dbc41
...
...
@@ -95,7 +95,7 @@ int read_toc ( thread_vcd_data_t * p_vcd )
p_vcd
->
nb_tracks
=
tochdr
.
cdth_trk1
;
/* nb_tracks + 1 because we put the lead_out tracks for computing last
track's size */
p_vcd
->
tracks_sector
=
malloc
(
(
p_vcd
->
nb_tracks
+
1
)
p_vcd
->
tracks_sector
=
malloc
(
(
p_vcd
->
nb_tracks
+
1
)
*
sizeof
(
int
)
);
if
(
p_vcd
->
tracks_sector
==
NULL
)
{
...
...
@@ -105,18 +105,18 @@ int read_toc ( thread_vcd_data_t * p_vcd )
/* then for each track we read its TOC entry */
for
(
i
=
tochdr
.
cdth_trk0
;
i
<=
tochdr
.
cdth_trk1
;
i
++
)
for
(
i
=
tochdr
.
cdth_trk0
;
i
<=
tochdr
.
cdth_trk1
;
i
++
)
{
tocent
.
cdte_track
=
i
;
tocent
.
cdte_format
=
CDROM_LBA
;
if
(
ioctl
(
fd
,
CDROMREADTOCENTRY
,
&
tocent
)
==
-
1
)
tocent
.
cdte_track
=
i
;
tocent
.
cdte_format
=
CDROM_LBA
;
if
(
ioctl
(
fd
,
CDROMREADTOCENTRY
,
&
tocent
)
==
-
1
)
{
intf_ErrMsg
(
"problem occured when reading CD's TOCENTRY
\n
"
)
;
free
(
p_vcd
->
tracks_sector
)
;
return
-
1
;
intf_ErrMsg
(
"problem occured when reading CD's TOCENTRY
\n
"
)
;
free
(
p_vcd
->
tracks_sector
)
;
return
-
1
;
}
p_vcd
->
tracks_sector
[
i
]
=
tocent
.
cdte_addr
.
lba
;
p_vcd
->
tracks_sector
[
i
-
1
]
=
tocent
.
cdte_addr
.
lba
;
}
...
...
@@ -132,7 +132,7 @@ int read_toc ( thread_vcd_data_t * p_vcd )
return
-
1
;
}
p_vcd
->
tracks_sector
[
p_vcd
->
nb_tracks
+
1
]
=
tocent
.
cdte_addr
.
lba
;
p_vcd
->
tracks_sector
[
p_vcd
->
nb_tracks
]
=
tocent
.
cdte_addr
.
lba
;
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment