1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

frame: fix the error path in av_frame_copy_props()

First free metadata, then the side data it is contained in.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Roman Savchenko 2014-05-28 22:16:56 +02:00 committed by Anton Khirnov
parent ad0fe2f401
commit a53551cba8

View File

@ -383,8 +383,8 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
if (!sd_dst) { if (!sd_dst) {
for (i = 0; i < dst->nb_side_data; i++) { for (i = 0; i < dst->nb_side_data; i++) {
av_freep(&dst->side_data[i]->data); av_freep(&dst->side_data[i]->data);
av_freep(&dst->side_data[i]);
av_dict_free(&dst->side_data[i]->metadata); av_dict_free(&dst->side_data[i]->metadata);
av_freep(&dst->side_data[i]);
} }
av_freep(&dst->side_data); av_freep(&dst->side_data);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);