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

Michael Niedermayer michaelni at gmx.at
Sun May 15 20:48:05 CEST 2011


On Sun, May 15, 2011 at 12:33:31PM +0200, Stefano Sabatini wrote:
> 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)...

whatever you prefer.
i doubt anyone will check the error code, so the value is unlikely to
make a difference

so its LGTM with whatever error code you prefer

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110515/0d660d11/attachment.asc>


More information about the ffmpeg-devel mailing list