[FFmpeg-devel] [PATCH] Document and validate AVFrame plane pointers.

wm4 nfxjfg at googlemail.com
Sat Feb 27 13:07:53 CET 2016


On Sat, 27 Feb 2016 12:54:50 +0100
Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:

> On Fri, Feb 26, 2016 at 11:41:41PM +0100, wm4 wrote:
> > On Fri, 26 Feb 2016 22:59:17 +0100
> > Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:  
> > > > Can you move it to a separate function? Say, ff_verify_frame(). This
> > > > could get much more complicated too when checking AVBufferRef usage or
> > > > audio.    
> > > 
> > > Why ff_? If we've decided on it and use it in other places it
> > > might become a av_* function in libavutil.
> > > But until then I guess it should be a static function in that file?  
> > 
> > For now it also might be used in the encoding functions. Don't know how
> > far it could go.  
> 
> They are in the same file though, so static would still be fine.
> However as for encoding those are const AVFrames I think it
> is much less of an issue (should only cause overreads, not
> writes) and I'm more inclined to not change things that
> after all might break someone's (probably quite crappy) code.

If you look at avcodec_encode_audio2(), it already contains a huge
chunk of code that somehow checks aspects of the AVFrame from the user.
Could be unified one day.


More information about the ffmpeg-devel mailing list