aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-12-15 04:32:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:07 +0200
commita54aaa822ae7aefd3efb983c186a55c304222a18 (patch)
tree14e95f8589d0c3cff43862ebbdd046686afb1527
parent4e6706f851d388163a7cfe53529810ec8888d95d (diff)
downloadffmpeg-a54aaa822ae7aefd3efb983c186a55c304222a18.tar.gz
lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data count. This can blow up later in av_frame_unref() and free_side_data(). Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a400edbb6d00c0211de38e4f1b4f593681db91d8) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/frame.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 7584ae3587..f16b72f07e 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -472,6 +472,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
av_dict_free(&dst->side_data[i]->metadata);
}
av_freep(&dst->side_data);
+ dst->nb_side_data = 0;
return AVERROR(ENOMEM);
}
memcpy(sd_dst->data, sd_src->data, sd_src->size);