On Fri, Feb 26, 2016 at 11:06:22PM +0100, Reimar Döffinger wrote: > Check that the required plane pointers and only > those are set up. > > Signed-off-by: Reimar Döffinger <reimar.doeffin...@gmx.de> > --- > libavcodec/utils.c | 20 ++++++++++++++++++++ > libavutil/frame.h | 3 +++ > 2 files changed, 23 insertions(+) > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > index af21cdd..1b6397c 100644 > --- a/libavcodec/utils.c > +++ b/libavcodec/utils.c > @@ -853,6 +853,24 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame > *frame) > return ff_init_buffer_info(avctx, frame); > } > > +static void validate_avframe_allocation(const AVCodecContext *avctx, AVFrame > *frame) > +{ > + if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { > + int i; > + int num_planes = av_pix_fmt_count_planes(frame->format); > + for (i = 0; i < num_planes; i++) { > + av_assert0(frame->data[i]); > + } > + // for formats without data like hwaccel allow > + // pointers to be non-NULL.
> + for (i = num_planes; num_planes > 0 && i < num_planes; i++) { are both of i = num_planes and i < num_planes intended ? some note in APIChanges or release notes or something might make sense too [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel