Skip to content
Permalink
Browse files Browse the repository at this point in the history
avcodec/g2meet: fix src pointer checks in kempf_decode_tile()
Fixes Ticket2842

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Aug 7, 2013
1 parent 5cd57e8 commit 2960576
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libavcodec/g2meet.c
Expand Up @@ -389,7 +389,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
return 0;
zsize = (src[0] << 8) | src[1]; src += 2;

if (src_end - src < zsize)
if (src_end - src < zsize + (sub_type != 2))
return AVERROR_INVALIDDATA;

ret = uncompress(c->kempf_buf, &dlen, src, zsize);
Expand All @@ -411,6 +411,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) {
if (!bits) {
if (src >= src_end)
return AVERROR_INVALIDDATA;
bitbuf = *src++;
bits = 8;
}
Expand Down

0 comments on commit 2960576

Please sign in to comment.