[FFmpeg-devel] [PATCH] avcodec_default_get_buffer should fail instead of returning nonsense for unsupported formats

Michael Niedermayer michaelni
Mon Feb 23 16:08:31 CET 2009

On Mon, Feb 23, 2009 at 12:46:13PM +0100, Reimar D?ffinger wrote:
> Hello,
> currently avcodec_default_get_buffer returns complete nonsense when
> calling it e.g. to request a VDPAU format.
> An obvious solution is to check the return value of ff_fill_pointer,
> if it is -1 continuing (and treating -1 as size) obviously makes no
> sense.
> I suspect that some stuff might need to be freed, e.g.
> (*picture_number)++;
> undone but I still have hope that there is someone who knows the code
> well enough to implement it correctly so I don't have to try to
> understand all of it.
> This is the change I had in mind and at least fixes a crash if
> get_buffer is not overridden but a hardware-accelerated pixfmt selected:

your patch looks ok

about picture_number, after get_buffer fails teh decoder will crash or
fail fatally its value should with some luck not matter.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090223/707cf6e7/attachment.pgp>

More information about the ffmpeg-devel mailing list