summaryrefslogtreecommitdiff
path: root/libavformat/mp3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-18 04:04:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-18 04:04:37 +0100
commit0b75b6c3cd2cb4775729bf019c25c4792a2729d4 (patch)
treeca34f316b555027dc41e4cb4cd35d969724be10e /libavformat/mp3dec.c
parent9bb6e1175f6e396c9314449d62ee67b74081104e (diff)
avformat/mp3dec: avoid seeking to negative positions
Fixes Ticket4038 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mp3dec.c')
-rw-r--r--libavformat/mp3dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 8208dbb628..c4c1bb7ca5 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -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 candidate = -1;
int score = 999;
+
+ if (pos < 0)
+ continue;
+
for(j=0; j<MIN_VALID; j++) {
ret = check(s, pos);
if(ret < 0)