Commit a503afb1 authored by Michael Niedermayer's avatar Michael Niedermayer

mpc: clip seeking timestamp in valid range

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b9b97c2f
......@@ -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 */
......
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