On Wed, Mar 09, 2016 at 10:27:50AM +0100, Clément Bœsch wrote: > On Tue, Mar 08, 2016 at 09:14:58PM +0100, Michael Niedermayer wrote: > > This should detect caes where these functions are called in unclean > > destinations > > --- > > libavutil/frame.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/libavutil/frame.c b/libavutil/frame.c > > index 5607206..dde32b0 100644 > > --- a/libavutil/frame.c > > +++ b/libavutil/frame.c > > @@ -375,6 +375,9 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src) > > { > > int i, ret = 0; > > > > + av_assert0(dst->width == 0 && dst->height == 0); > > + av_assert0(dst->channels == 0); > > + > > dst->format = src->format; > > dst->width = src->width; > > dst->height = src->height; > > @@ -504,6 +507,9 @@ void av_frame_unref(AVFrame *frame) > > > > void av_frame_move_ref(AVFrame *dst, AVFrame *src) > > { > > + av_assert0(dst->width == 0 && dst->height == 0); > > + av_assert0(dst->channels == 0); > > + > > *dst = *src; > > if (src->extended_data == src->data) > > dst->extended_data = dst->data; > > That's a good idea but downstream developers might prefer their users to > experience a memleak that random violent aborts. I would probably make it > at assert level 1.
locally changed thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Asymptotically faster algorithms should always be preferred if you have asymptotical amounts of data
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel