Message ID | 20240607003215.1723906-1-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/5] avformat/mov: Check requested_sample before using it | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Fri, Jun 07, 2024 at 02:32:11AM +0200, Michael Niedermayer wrote: > 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> > --- > libavformat/mov.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply remaining patches of this set [...]
diff --git a/libavformat/mov.c b/libavformat/mov.c index 9016cd5ad08..f571b0468ee 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -10161,7 +10161,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;
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> --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)