diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-06 23:24:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-02 21:57:23 +0200 |
commit | 64df7d4c1ee30b4be500f6aac2fc81b78b987af6 (patch) | |
tree | 53418871a3a5f260a025b3abd660d3cf4f4add26 | |
parent | a469e48b6dd8c9dfd0cd7dba7b28d1987168ed8b (diff) | |
download | ffmpeg-64df7d4c1ee30b4be500f6aac2fc81b78b987af6.tar.gz |
avformat/mov: Check requested_sample before using it
I am not sure the case described by coverity is possible
but its more robust checking the argument first
Fixes: CID1598441 Improper use of negative value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7b1f90c890..a3951a6942 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -10486,7 +10486,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, // If we've reached a different sample trying to find a good pts to // seek to, give up searching because we'll end up seeking back to // sample 0 on every seek. - if (!can_seek_to_key_sample(st, requested_sample, next_ts) && sample != requested_sample) + if (sample != requested_sample && !can_seek_to_key_sample(st, requested_sample, next_ts)) break; timestamp = next_ts; |