summaryrefslogtreecommitdiff
path: root/libavformat/mpc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-27 04:51:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-27 04:51:27 +0200
commita503afb11f80facc0fa12b733c5c58989950b108 (patch)
tree31b0c29f2faea16f946f5712580e9ac63ba9ff57 /libavformat/mpc.c
parentb9b97c2fb916982c87b74821117fc6c41a80aa7e (diff)
downloadffmpeg-a503afb11f80facc0fa12b733c5c58989950b108.tar.gz
mpc: clip seeking timestamp in valid range
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpc.c')
-rw-r--r--libavformat/mpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index 4ebc6ae184..2ca8dfa4dd 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -194,7 +194,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
MPCContext *c = s->priv_data;
AVPacket pkt1, *pkt = &pkt1;
int ret;
- int index = av_index_search_timestamp(st, timestamp - DELAY_FRAMES, flags);
+ int index = av_index_search_timestamp(st, FFMAX(timestamp - DELAY_FRAMES, 0), flags);
uint32_t lastframe;
/* if found, seek there */