On 24-Nov-2014 5:17 am, "Lukasz Marek" <lukasz.m.lu...@gmail.com> wrote: > > Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com> > --- > libavcodec/options.c | 23 +++++++++++------------ > 1 file changed, 11 insertions(+), 12 deletions(-) > > diff --git a/libavcodec/options.c b/libavcodec/options.c > index 7f9fb07..8ba997c 100644 > --- a/libavcodec/options.c > +++ b/libavcodec/options.c > @@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) > } > > av_opt_free(dest); > + av_freep(&dest->rc_override); > + av_freep(&dest->intra_matrix); > + av_freep(&dest->inter_matrix); > + av_freep(&dest->extradata); > + av_freep(&dest->subtitle_header); > > memcpy(dest, src, sizeof(*dest)); > av_opt_copy(dest, src); > @@ -205,13 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) > dest->slice_offset = NULL; > dest->hwaccel = NULL; > dest->internal = NULL; > - > - /* reallocate values that should be allocated separately */ > - dest->extradata = NULL; > - dest->intra_matrix = NULL; > - dest->inter_matrix = NULL; > - dest->rc_override = NULL; > - dest->subtitle_header = NULL;
This assignments should stay in case of copy error below. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel