Changeset 709367d842d0c3c0b79e2fd125398d2147bd226e
- Timestamp:
- 03/21/08 15:03:29
(5 months ago)
- Author:
- Filippo Carone <littlejohn@videolan.org>
- git-committer:
- Filippo Carone <littlejohn@videolan.org> 1206108209 +0100
- git-parent:
[5f584e4c451865ea350cd54e28a4d1417d50e9c6]
- git-author:
- Filippo Carone <littlejohn@videolan.org> 1206108209 +0100
- Message:
fix for #1533: check on array boundaries before removing media
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5f584e4 |
r709367d |
|
| 100 | 100 | mlist.removeMedia(new MediaDescriptor(jvlc, mrl)); |
|---|
| 101 | 101 | Assert.assertEquals(0, mlist.itemsCount()); |
|---|
| 102 | | |
|---|
| | 102 | } |
|---|
| | 103 | |
|---|
| | 104 | @Test |
|---|
| | 105 | public void mediaListRemoveNonExistingMedia() |
|---|
| | 106 | { |
|---|
| | 107 | MediaList mlist = new MediaList(jvlc); |
|---|
| | 108 | boolean result = mlist.removeMedia(3); |
|---|
| | 109 | Assert.assertFalse(result); |
|---|
| 103 | 110 | } |
|---|
| 104 | 111 | |
|---|
| rcd3ea88 |
r709367d |
|
| 398 | 398 | libvlc_exception_t * p_e ) |
|---|
| 399 | 399 | { |
|---|
| 400 | | VLC_UNUSED(p_e); |
|---|
| 401 | 400 | |
|---|
| 402 | 401 | libvlc_media_descriptor_t * p_md; |
|---|
| 403 | 402 | |
|---|
| | 403 | if( index < 0 || index > vlc_array_count( &p_mlist->items )) |
|---|
| | 404 | { |
|---|
| | 405 | libvlc_exception_raise( p_e, "Index out of bounds exception"); |
|---|
| | 406 | return; |
|---|
| | 407 | } |
|---|
| | 408 | |
|---|
| 404 | 409 | p_md = vlc_array_item_at_index( &p_mlist->items, index ); |
|---|
| 405 | 410 | |
|---|