Changeset 6504e7eb7438b06b95e6907ba0e45006e480d57c
- Timestamp:
- 13/12/07 17:39:33
(1 year ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1197563973 +0000
- git-parent:
[8e6a26cadc299c381096a641c700a5d8d5608896]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1197563973 +0000
- Message:
Patch by Jilles Tjoelker. Fixes crash in playlist due to negative index in playlist item array. Added boundary check to solve this.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rba0f64f |
r6504e7e |
|
| 387 | 387 | p_playlist->i_current_index = -1; |
|---|
| 388 | 388 | |
|---|
| 389 | | if( p_playlist->current.i_size && i_skip > 0 ) |
|---|
| 390 | | { |
|---|
| | 389 | if( p_playlist->current.i_size && (i_skip > 0) ) |
|---|
| | 390 | { |
|---|
| | 391 | if( p_playlist->i_current_index < -1 ) |
|---|
| | 392 | p_playlist->i_current_index = -1; |
|---|
| 391 | 393 | for( i = i_skip; i > 0 ; i-- ) |
|---|
| 392 | 394 | { |
|---|
| 393 | 395 | p_playlist->i_current_index++; |
|---|
| 394 | | if( p_playlist->i_current_index == p_playlist->current.i_size ) |
|---|
| | 396 | if( p_playlist->i_current_index >= p_playlist->current.i_size ) |
|---|
| 395 | 397 | { |
|---|
| 396 | 398 | PL_DEBUG( "looping - restarting at beginning of node" ); |
|---|
| … | … | |
| 401 | 403 | p_playlist->i_current_index ); |
|---|
| 402 | 404 | } |
|---|
| 403 | | else if( p_playlist->current.i_size && i_skip < 0 ) |
|---|
| | 405 | else if( p_playlist->current.i_size && (i_skip < 0) ) |
|---|
| 404 | 406 | { |
|---|
| 405 | 407 | for( i = i_skip; i < 0 ; i++ ) |
|---|
| 406 | 408 | { |
|---|
| 407 | 409 | p_playlist->i_current_index--; |
|---|
| 408 | | if( p_playlist->i_current_index == -1 ) |
|---|
| | 410 | if( p_playlist->i_current_index <= -1 ) |
|---|
| 409 | 411 | { |
|---|
| 410 | 412 | PL_DEBUG( "looping - restarting at end of node" ); |
|---|