"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavcodec/dfa.c" between
libav-12.1.tar.gz and libav-12.2.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

dfa.c  (libav-12.1):dfa.c  (libav-12.2)
skipping to change at line 147 skipping to change at line 147
return 0; return 0;
} }
static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height ) static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height )
{ {
const uint8_t *frame_start = frame; const uint8_t *frame_start = frame;
const uint8_t *frame_end = frame + width * height; const uint8_t *frame_end = frame + width * height;
int mask = 0x10000, bitbuf = 0; int mask = 0x10000, bitbuf = 0;
int i, v, offset, count, segments; int i, v, offset, count, segments;
if ((width | height) & 1)
return AVERROR_INVALIDDATA;
segments = bytestream2_get_le16(gb); segments = bytestream2_get_le16(gb);
while (segments--) { while (segments--) {
if (bytestream2_get_bytes_left(gb) < 2) if (bytestream2_get_bytes_left(gb) < 2)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (mask == 0x10000) { if (mask == 0x10000) {
bitbuf = bytestream2_get_le16u(gb); bitbuf = bytestream2_get_le16u(gb);
mask = 1; mask = 1;
} }
if (bitbuf & mask) { if (bitbuf & mask) {
skipping to change at line 174 skipping to change at line 176
frame[width] = frame[width + 1] = frame[-offset]; frame[width] = frame[width + 1] = frame[-offset];
frame += 2; frame += 2;
} }
} else if (bitbuf & (mask << 1)) { } else if (bitbuf & (mask << 1)) {
v = bytestream2_get_le16(gb)*2; v = bytestream2_get_le16(gb)*2;
if (frame - frame_end < v) if (frame - frame_end < v)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
frame += v; frame += v;
} else { } else {
if (frame_end - frame < width + 3) if (width < 4 || frame_end - frame < width + 4)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
frame[0] = frame[1] = frame[0] = frame[1] =
frame[width] = frame[width + 1] = bytestream2_get_byte(gb); frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
frame += 2; frame += 2;
frame[0] = frame[1] = frame[0] = frame[1] =
frame[width] = frame[width + 1] = bytestream2_get_byte(gb); frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
frame += 2; frame += 2;
} }
mask <<= 2; mask <<= 2;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)