Mercurial > mplayer.hg
comparison libswscale/swscale.c @ 22392:c49960cb9e1e
copy src to prevent the user supplied argumet from being changed
author | michael |
---|---|
date | Fri, 02 Mar 2007 13:32:10 +0000 |
parents | 5f47768cbda5 |
children | d98166c91eea |
comparison
equal
deleted
inserted
replaced
22391:4336bf615eeb | 22392:c49960cb9e1e |
---|---|
2433 if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1; | 2433 if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1; |
2434 } | 2434 } |
2435 | 2435 |
2436 // copy strides, so they can safely be modified | 2436 // copy strides, so they can safely be modified |
2437 if (c->sliceDir == 1) { | 2437 if (c->sliceDir == 1) { |
2438 uint8_t* src2[4]= {src[0], src[1], src[2]}; | |
2438 // slices go from top to bottom | 2439 // slices go from top to bottom |
2439 int srcStride2[3]= {srcStride[0], srcStride[1], srcStride[2]}; | 2440 int srcStride2[3]= {srcStride[0], srcStride[1], srcStride[2]}; |
2440 int dstStride2[3]= {dstStride[0], dstStride[1], dstStride[2]}; | 2441 int dstStride2[3]= {dstStride[0], dstStride[1], dstStride[2]}; |
2441 return c->swScale(c, src, srcStride2, srcSliceY, srcSliceH, dst, dstStride2); | 2442 return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst, dstStride2); |
2442 } else { | 2443 } else { |
2443 // slices go from bottom to top => we flip the image internally | 2444 // slices go from bottom to top => we flip the image internally |
2444 uint8_t* src2[3]= {src[0] + (srcSliceH-1)*srcStride[0], | 2445 uint8_t* src2[3]= {src[0] + (srcSliceH-1)*srcStride[0], |
2445 src[1] + ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[1], | 2446 src[1] + ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[1], |
2446 src[2] + ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[2] | 2447 src[2] + ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[2] |