Skip to content

Commit

Permalink
fixed #2424
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Mar 27, 2023
1 parent 7fffe04 commit 8912a05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scene_manager/swf_parse.c
Expand Up @@ -98,8 +98,12 @@ static void swf_init_decompress(SWFReader *read)
uLongf destLen;
char *src, *dst;

assert(gf_bs_get_size(read->bs)-8 < (u64)1<<31); /*must fit within 32 bits*/
size = (u32) gf_bs_get_size(read->bs)-8;
if (gf_bs_get_size(read->bs) - 8 >= (u64)1<<31) {
gf_bs_del(read->bs);
read->bs = NULL;
return;
}
dst_size = read->length;
src = gf_malloc(sizeof(char)*size);
dst = gf_malloc(sizeof(char)*dst_size);
Expand Down Expand Up @@ -2620,6 +2624,7 @@ GF_Err gf_swf_read_header(SWFReader *read)
/*if compressed decompress the whole file*/
if (sig[0] == 'C') {
swf_init_decompress(read);
if (!read->bs) return GF_NON_COMPLIANT_BITSTREAM;
}

swf_get_rec(read, &rc);
Expand Down

0 comments on commit 8912a05

Please sign in to comment.