diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-02 13:32:10 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-02 13:32:10 +0000 |
commit | 0c8400132500c50d70969f76957bcb16fa68197d (patch) | |
tree | c9b75c17d8dc8c3480056be7fff8d252a9073e21 /libswscale | |
parent | b09b580b4dc118a1eedceee529614ad0fb4e310a (diff) | |
download | ffmpeg-streaming-0c8400132500c50d70969f76957bcb16fa68197d.zip ffmpeg-streaming-0c8400132500c50d70969f76957bcb16fa68197d.tar.gz |
copy src to prevent the user supplied argumet from being changed
Originally committed as revision 22410 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 0c1f8f3..b33623a 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2435,10 +2435,11 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, // copy strides, so they can safely be modified if (c->sliceDir == 1) { + uint8_t* src2[4]= {src[0], src[1], src[2]}; // slices go from top to bottom int srcStride2[3]= {srcStride[0], srcStride[1], srcStride[2]}; int dstStride2[3]= {dstStride[0], dstStride[1], dstStride[2]}; - return c->swScale(c, src, srcStride2, srcSliceY, srcSliceH, dst, dstStride2); + return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst, dstStride2); } else { // slices go from bottom to top => we flip the image internally uint8_t* src2[3]= {src[0] + (srcSliceH-1)*srcStride[0], |