Remove panscan information in av_frame_copy_props() if resolution changes.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 10 Aug 2014 20:31:33 +0000 (22:31 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 10 Aug 2014 20:31:33 +0000 (22:31 +0200)
Fixes ticket #3750.

libavutil/frame.c

index 67a7d3e..12eac55 100644 (file)
@@ -492,7 +492,11 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
 
     for (i = 0; i < src->nb_side_data; i++) {
         const AVFrameSideData *sd_src = src->side_data[i];
-        AVFrameSideData *sd_dst = av_frame_new_side_data(dst, sd_src->type,
+        AVFrameSideData *sd_dst;
+        if (   sd_src->type == AV_FRAME_DATA_PANSCAN
+            && (src->width != dst->width || src->height != dst->height))
+            continue;
+        sd_dst = av_frame_new_side_data(dst, sd_src->type,
                                                          sd_src->size);
         if (!sd_dst) {
             for (i = 0; i < dst->nb_side_data; i++) {