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
709367d8
Commit
709367d8
authored
Mar 21, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for #1533: check on array boundaries before removing media
parent
5f584e4c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java
...a/core/src/test/java/org/videolan/jvlc/MediaListTest.java
+8
-1
src/control/media_list.c
src/control/media_list.c
+6
-1
No files found.
bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java
View file @
709367d8
...
...
@@ -99,7 +99,14 @@ public class MediaListTest
mlist
.
addMediaDescriptor
(
new
MediaDescriptor
(
jvlc
,
mrl
));
mlist
.
removeMedia
(
new
MediaDescriptor
(
jvlc
,
mrl
));
Assert
.
assertEquals
(
0
,
mlist
.
itemsCount
());
}
@Test
public
void
mediaListRemoveNonExistingMedia
()
{
MediaList
mlist
=
new
MediaList
(
jvlc
);
boolean
result
=
mlist
.
removeMedia
(
3
);
Assert
.
assertFalse
(
result
);
}
...
...
src/control/media_list.c
View file @
709367d8
...
...
@@ -397,10 +397,15 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
int
index
,
libvlc_exception_t
*
p_e
)
{
VLC_UNUSED
(
p_e
);
libvlc_media_descriptor_t
*
p_md
;
if
(
index
<
0
||
index
>
vlc_array_count
(
&
p_mlist
->
items
))
{
libvlc_exception_raise
(
p_e
,
"Index out of bounds exception"
);
return
;
}
p_md
=
vlc_array_item_at_index
(
&
p_mlist
->
items
,
index
);
notify_item_deletion
(
p_mlist
,
p_md
,
index
,
EventWillHappen
);
...
...
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