[FFmpeg-devel] [PATCH] make sure initialization happens even after goto fires

Erik Hovland erik
Thu Jul 17 20:12:04 CEST 2008


On Thu, Jul 17, 2008 at 07:03:43PM +0200, Michael Niedermayer wrote:
> On Thu, Jul 17, 2008 at 09:08:40AM -0700, Erik Hovland wrote:
> > The goto in ff_h264_find_frame_end() is inside an else clause. The
> > initialization for v happens in the if clause elsewhere. That means that
> > it is possible for the goto to fire without the initialization of v
> > happening. Normally this isn't a problem. But gcc recognizes this and
> > throws an internal parse warning. It then has to go through a special
> > code branch to take care of this. If the initialization of v always
> > happens before either clause this does not happen. The attached patch
> > does just that.
> 
> Is there any bug in our code?

Well, that is an interesting question. It would be a bug if the goto
fired without v being initialized. Which is possible, but highly
unlikely.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request





More information about the ffmpeg-devel mailing list