[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Re: Nellymoser audio segfaults (bug #24355])

From: Sandro Santilli
Subject: [Gnash-dev] Re: Nellymoser audio segfaults (bug #24355])
Date: Tue, 23 Sep 2008 14:51:40 +0200

On Tue, Sep 23, 2008 at 01:46:39PM +0200, Benjamin Wolsey wrote:
> I tried playing an FLV with nellymoser audio, only to discover that
> Gnash segfaults. It's nothing to do with decoding, but rather the core
> continues to use an AudioDecoder that failed to find a suitable codec
> and cannot decode anything.
> There is a simple fix for it in MediaHandler.h (return a 0 pointer if
> setup fails). A better way (I think) is to drop setup as an AudioDecoder
> member and pass the AudioInfo or SoundInfo straight to the constructor.
> Fatal errors can throw a MediaException in the constructor and a try /
> catch ensures that objects with such fatal errors are never constructed.
> I implemented the same with VideoDecoder (for exactly the same bug) a
> few weeks ago.

>From MediaHandler.h documentation I read:

        /// Create a VideoDecoder for the specified codec_type
        /// @return 0 if no decoder could be created for the specified encoding
        virtual std::auto_ptr<VideoDecoder> createVideoDecoder(VideoInfo& 

I like that design in general.
Yes, there might be other exceptions thrown for OOM conditions or similar,
but I'd rather have MediaHandler catch them then MediaHandler users.

I belive MediaHandler factory methods should either return the fully
constructed object requested, or the NULL auto_ptr.

The bug I see is that MediaHandlerFfmpeg::createAudioDecoder is just
not checking return code from AudioDecoderFfmpeg::setup.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]