Browse Source

swscale: prevent invalid writes in packed_16bpc_bswap

Writes past the end of the destination buffer were occuring when its
stride was smaller than the stride of the source. Fixes Bug #183.
tags/n0.10
Janne Grunau 14 years ago
parent
commit
6e9bb5aa3e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libswscale/swscale_unscaled.c

+ 2
- 1
libswscale/swscale_unscaled.c View File

@@ -285,9 +285,10 @@ static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
int dststr = dstStride[0] >> 1;
uint16_t *dstPtr = (uint16_t *) dst[0];
const uint16_t *srcPtr = (const uint16_t *) src[0];
int min_stride = FFMIN(srcstr, dststr);

for (i = 0; i < srcSliceH; i++) {
for (j = 0; j < srcstr; j++) {
for (j = 0; j < min_stride; j++) {
dstPtr[j] = av_bswap16(srcPtr[j]);
}
srcPtr += srcstr;


Loading…
Cancel
Save