On Fri, 25 Oct 2013 18:34:26 +0200, Vittorio Giovara <[email protected]> wrote: > On Fri, Oct 25, 2013 at 4:41 PM, Anton Khirnov <[email protected]> wrote: > > > diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c > > new file mode 100644 > > index 0000000..91ebaac > > --- /dev/null > > +++ b/libavcodec/hevc. > > +static int verify_md5(HEVCContext *s, AVFrame *frame) > > +{ > > + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); > > + int pixel_shift = desc->comp[0].depth_minus1 > 7; > > + int i, j; > > + > > + if (!desc) > > + return AVERROR(EINVAL); > > I think this popped out on IRC some time ago, but there was no clear > decision on whether something should be done on it. > The ideas were: > - if it should never happen, then let's not check it?
Indeed currently it should never happen unless your install is broken, since we only allow/support libraries coming from the same tree. But in some bright hypothetical future we might be more liberal about this, so it's better to check it. > - or let's add a proper averror? I think AVERROR_BUG is appropriate here. > - why av_pix_fmt_desc_get returns a pointer? What else should it return. Whole struct? Then we should still check it got filled properly AND we'd have made its size a part of public ABI. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
