Commit 0b75b6c3 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mp3dec: avoid seeking to negative positions

Fixes Ticket4038
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9bb6e117
...@@ -457,6 +457,10 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, ...@@ -457,6 +457,10 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i); int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i);
int64_t candidate = -1; int64_t candidate = -1;
int score = 999; int score = 999;
if (pos < 0)
continue;
for(j=0; j<MIN_VALID; j++) { for(j=0; j<MIN_VALID; j++) {
ret = check(s, pos); ret = check(s, pos);
if(ret < 0) if(ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment