[FFmpeg-devel] [PATCH] avformat/avio: avio_tell() only errors if the context is NULL

Michael Niedermayer michael at niedermayer.cc
Tue Jul 23 01:41:23 EEST 2024


On Wed, Jul 17, 2024 at 08:47:45AM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2024-07-11 11:49:37)
> > Found by code review related to coverity
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavformat/avio.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/avio.h b/libavformat/avio.h
> > index ebf611187dc..3be91e4b8a7 100644
> > --- a/libavformat/avio.h
> > +++ b/libavformat/avio.h
> > @@ -489,7 +489,7 @@ int64_t avio_skip(AVIOContext *s, int64_t offset);
> >  
> >  /**
> >   * ftell() equivalent for AVIOContext.
> > - * @return position or AVERROR.
> > + * @return position or AVERROR in case s is NULL.
> 
> It seems weird to document an invalid call.

its mainly a reminder that this doesnt return AVERROR arbitrarily and thus
doesnt need to be checked

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240723/5f4c8e5d/attachment.sig>


More information about the ffmpeg-devel mailing list