diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-11-20 10:46:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 10:46:15 +0100 |
commit | 3924aa6e8f51ba8be3b40c0a0777252ad6f29c0c (patch) | |
tree | b4e5aaf399eb7d4992b39b492defce55b2535f2a /thirdparty/libogg/framing.c | |
parent | 882d61791bee895cc411b3e59a61291fd335b07e (diff) | |
parent | 77efd406bfde63f2d0ac2077dfbec48a75bb1e22 (diff) |
Merge pull request #55119 from akien-mga/libogg-1.3.5
Diffstat (limited to 'thirdparty/libogg/framing.c')
-rw-r--r-- | thirdparty/libogg/framing.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/thirdparty/libogg/framing.c b/thirdparty/libogg/framing.c index 83601199ad..724d116d7f 100644 --- a/thirdparty/libogg/framing.c +++ b/thirdparty/libogg/framing.c @@ -597,9 +597,14 @@ char *ogg_sync_buffer(ogg_sync_state *oy, long size){ if(size>oy->storage-oy->fill){ /* We need to extend the internal buffer */ - long newsize=size+oy->fill+4096; /* an extra page to be nice */ + long newsize; void *ret; + if(size>INT_MAX-4096-oy->fill){ + ogg_sync_clear(oy); + return NULL; + } + newsize=size+oy->fill+4096; /* an extra page to be nice */ if(oy->data) ret=_ogg_realloc(oy->data,newsize); else @@ -1564,7 +1569,7 @@ void test_pack(const int *pl, const int **headers, int byteskip, byteskipcount=byteskip; } - ogg_sync_wrote(&oy,next-buf); + ogg_sync_wrote(&oy,(long)(next-buf)); while(1){ int ret=ogg_sync_pageout(&oy,&og_de); |