frame: fix the error path in av_frame_copy_props()
authorRoman Savchenko <gmstima@gmail.com>
Wed, 28 May 2014 20:16:56 +0000 (22:16 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 29 May 2014 05:59:56 +0000 (07:59 +0200)
First free metadata, then the side data it is contained in.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavutil/frame.c

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