X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdfa.c;h=3ea12f05118aa572c22d13128ef0f348a0988314;hb=e1b60aad77c27ed5d4dfc11e5e6a05a38c70489d;hp=f45d019a79200f2440f961529f12beb1c1d892f6;hpb=2ea6310f4ae7509d7711fdb7cf86e80c189afa8b;p=ffmpeg diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index f45d019a792..3ea12f05118 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -67,7 +67,8 @@ static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; - int v, count, segments; + int v, count; + unsigned segments; unsigned offset; segments = bytestream2_get_le32(gb); @@ -175,7 +176,7 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height return AVERROR_INVALIDDATA; frame += v; } else { - if (frame_end - frame < width + 3) + if (frame_end - frame < width + 4) return AVERROR_INVALIDDATA; frame[0] = frame[1] = frame[width] = frame[width + 1] = bytestream2_get_byte(gb);