[FFmpeg-devel] [PATCH 1/2] vf_paletteuse: Add error checking to apply_palette

Clément Bœsch u at pkh.me
Wed Jan 3 00:16:12 EET 2018

On Tue, Jan 02, 2018 at 10:02:25PM +0000, Derek Buitenhuis wrote:
> On 1/2/2018 9:52 PM, Clément Bœsch wrote:
> > not exactly sure why you haven't just checked if `out` wasn't NULL, but it
> > should be fine that way too if you prefer it.
> > 
> > I guess that's only to provide a finer grain error handling? It would make
> > sense if ff_get_video_buffer was returning a meaningful error, but so far
> > you're just assuming EINVAL when it could be ENOMEM, so I don't really get
> > it.
> s->set_frame can return ENOMEM, which is why I made it finer grained.
> I'm not really sure what to return for ff_get_video_buffer failure, since
> it wasn't designed with any error mechanism for some reason.

I don't think you'll be much off by always assuming ENOMEM  here when
getting a NULL out frame, I think that's the common idiom when a function
supposed to return allocated stuff returns NULL.

But that's not very important, feel free to push as is if you prefer that

Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180102/88a72d7d/attachment.sig>

More information about the ffmpeg-devel mailing list