Fix a corner case in sws emulation
authorLuca Abeni <lucabe72@email.it>
Tue, 25 Jul 2006 15:23:44 +0000 (15:23 +0000)
committerLuca Abeni <lucabe72@email.it>
Tue, 25 Jul 2006 15:23:44 +0000 (15:23 +0000)
Originally committed as revision 5827 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/imgresample.c

index 26de52d..8ffcd79 100644 (file)
@@ -756,6 +756,9 @@ int sws_scale(struct SwsContext *ctx, uint8_t* src[], int srcStride[],
             res = -1;
             goto the_end;
         }
+    } else if (resampled_picture != &dst_pict) {
+        img_copy(&dst_pict, resampled_picture, current_pix_fmt,
+                        ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight);
     }
 
 the_end: