diff options
author | Tim Terriberry <tterribe@xiph.org> | 2010-10-13 23:17:20 +0000 |
---|---|---|
committer | Tim Terriberry <tterribe@xiph.org> | 2010-10-13 23:17:20 +0000 |
commit | 055a48d42a5779c15345713c09d3631d39698515 (patch) | |
tree | 2119e06ede0c01edf1db30cb96ae19032862e52f /info.c | |
parent | 88015f25dc5c29bf2819bfd8f7d2b46ec20dc204 (diff) | |
download | tremor-055a48d42a5779c15345713c09d3631d39698515.tar.gz |
Back out r17515.
This accidentally contained far more than I meant to commit.
git-svn-id: https://svn.xiph.org/trunk/Tremor@17516 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -21,7 +21,6 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#include <limits.h> #include <ogg/ogg.h> #include "ivorbiscodec.h" #include "codec_internal.h" @@ -195,9 +194,9 @@ static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ if(vc->vendor==NULL)goto err_out; _v_readstring(opb,vc->vendor,vendorlen); i=oggpack_read(opb,32); - if(i<0||i>=INT_MAX||i>(opb->storage-oggpack_bytes(opb))>>2)goto err_out; - vc->user_comments=(char **)_ogg_calloc(i+1,sizeof(*vc->user_comments)); - vc->comment_lengths=(int *)_ogg_calloc(i+1, sizeof(*vc->comment_lengths)); + if(i<0||i>(opb->storage-oggpack_bytes(opb))>>2)goto err_out; + vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments)); + vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths)); if(vc->user_comments==NULL||vc->comment_lengths==NULL)goto err_out; vc->comments=i; |