[FFmpeg-devel] Patch: explicitly initialize AVFormatContext *ic = NULL

Michael Niedermayer michaelni
Fri Jul 10 04:34:28 CEST 2009


On Fri, Jul 10, 2009 at 10:20:44AM +0800, avcoder wrote:
> On Fri, Jul 10, 2009 at 10:05 AM, Michael Niedermayer<michaelni at gmx.at> wrote:
> > On Thu, Jul 09, 2009 at 10:59:56PM +0800, avcoder wrote:
> >> Dear:
> >>
> >> "
> >> ? ? Fix mem leak when user preallocates an AVFormatContext, passes it to
> >> ? ? av_open_input_file(), but the file does not exist.
> >> ? ? Patch by Art Clarke a$(surname) xuggle com
> >>
> >>
> >> ? ? git-svn-id: file:///var/local/repositories/ffmpeg/trunk at 19370
> >> 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
> >> "
> >>
> >> The commit will cause error when calling av_freep() at the end of
> >> av_open_input_file() if we fail to explicitly initialize the args:
> >> AVFormatContext **ic_ptr in calling routine.
> >
> > then the patch should be reverted
> >
> 
> I agree!
> 
> But IMHO, Initialize AVForamatContext *ic = NULL is a safe coding
> style, and this modification unifies coding style with other
> av_open_input_file() usages in ffmpeg internal source code

The problem is that =NULL is in the applications (ffmpeg/ffplay/...)
and the ABI/API does not seem to require it, adding that requirement
makes libav incompatible with old applications ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

GMX, the mailprovider that uses RBL lists to reject mails from your friends
running their own mailserver at home. The mailprovider that obscures the
origin of mails (mis)identified as viruses. The mailprovider that improves
security my disallowing more secure forms of authentication.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090710/ec00f9ac/attachment.pgp>



More information about the ffmpeg-devel mailing list