[Ffmpeg-devel] Wavpack decoded packet size?

Kostya kostya.shishkov
Fri Oct 13 13:29:28 CEST 2006

On Fri, Oct 13, 2006 at 07:51:16AM +0300, Uoti Urpala wrote:
> On Fri, 2006-10-13 at 07:23 +0300, Kostya wrote:
> > > seconded, a decoder should not depend on a demuxer doing sanity checks
> > 
> > Maybe yes, but:
> > a) what decoders do actually check for overflow (I found only vorbis and raw PCM)
> Many formats have natural packet size limits below

Quite right but I don't know what to do with Monkey's Audio. It uses block
sizes up to several megabytes with insane compression level (_very_ appropriate name).

> > b) external demuxer may pass greater buffer to decoder and everything will be fine
> But can only do that safely if it has wavpack-specific code to check the
> size of the frames. And if you think external demuxer+internal decoder
> is an argument against checking the size in the decoder, then why did
> you put the check in the demuxer? Now you can't use internal demuxer
> +external decoder with big packets. Is there a reason why having the
> check in the demuxer is better than having it in the decoder? There's no
> reason the demuxer couldn't return arbitrarily big packets as long as
> they won't cause a buffer overflow in the decoder.

I'll move check to decoder then as it's really proper place for it.

> > this leads us to a long-discussed questions of API change (for audio, palette, etc.)
> The API could probably be improved, but as long as it isn't violating it
> in a way that can cause buffer overflows is worse.

More information about the ffmpeg-devel mailing list