X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=4fa38f55c0eb1d5904e16f061a35a546e3c09fe7;hp=88ba8b97dee46cfac6bd382ff3125e78b7735bf5;hb=1f86ebaac605b62901bd103b1f23b53979acc5a4;hpb=70dd52c811db9f1a38a472a37135986accc4c06e diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 88ba8b9..4fa38f5 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -561,7 +561,8 @@ static void tag_init_source(struct jpeg_decompress_struct *cinfo) static boolean tag_fill_input_buffer(struct jpeg_decompress_struct *cinfo) { TAG *tag = (TAG *) cinfo->client_data; - if (tag->data[tag->pos + 0] == 0xff && + if (tag->pos + 4 <= tag->len && + tag->data[tag->pos + 0] == 0xff && tag->data[tag->pos + 1] == 0xd9 && tag->data[tag->pos + 2] == 0xff && tag->data[tag->pos + 3] == 0xd8) {