[FFmpeg-devel] [PATCH] imgutils: make av_image_get_linesize() return 0 for invalid pixel formats

Stefano Sabatini stefano.sabatini-lala at poste.it
Sun May 15 12:33:31 CEST 2011


On date Friday 2011-05-13 17:51:53 +0200, Michael Niedermayer encoded:
> On Fri, May 13, 2011 at 05:24:53PM +0200, Stefano Sabatini wrote:
> > Make av_image_get_linesize() return 0 in case of invalid/meaningless
> > value for the pixel format.
> > 
> > This makes the behavior of av_image_get_linesize() more consistent
> > with that of av_image_fill_linesizes(), which sets all linesizes value
> > to 0 in that case.
> > 
> > Alternatively we may return AVERROR(EINVAL).
> > ---
> >  libavutil/imgutils.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> LGTM

Now rethinking at it maybe it's more meaningful to return
AVERROR(EINVAL)...
-- 
FFmpeg = Funny and Foolish Merciless Peaceful Encoding/decoding Game


More information about the ffmpeg-devel mailing list