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&
info)=0;
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.
--strk;
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev