[FFmpeg-devel] [PATCH] ffmpeg.c: Initializing uninitialized variables

Michael Niedermayer michaelni at gmx.at
Thu Sep 1 16:36:38 CEST 2011


On Thu, Sep 01, 2011 at 02:02:21PM +0000, Chiranjeevi Melam wrote:
> Hi,
> Most of these variables are set in static void do_audio_out(AVFormatContext *s,
> 
> If ffmpeg_exit() is called prior to calling do_audio_out, then it might try to do a free on an uninitialized variable. So the Changes  we made fixed the issue.

ISO C 6.7.8 Initialization
Constraint 10

 10 If an object that has automatic storage duration is not initialized explicitly, its value is
   indeterminate. If an object that has static storage duration is not initialized explicitly,
   then:
   -- if it has pointer type, it is initialized to a null pointer;
   -- if it has arithmetic type, it is initialized to (positive or unsigned) zero;
   -- if it is an aggregate, every member is initialized (recursively) according to these rules;
   -- if it is a union, the first named member is initialized (recursively) according to these
       rules.

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

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110901/7f284e77/attachment.asc>


More information about the ffmpeg-devel mailing list