[MPlayer-cvslog] CVS: main/libmpdemux demux_ogg.c,1.93,1.94
Richard Felker CVS
syncmail at mplayerhq.hu
Sat May 13 07:48:19 CEST 2006
CVS change done by Richard Felker CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv31869/libmpdemux
Modified Files:
demux_ogg.c
Log Message:
10^100l c++ declarations
Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- demux_ogg.c 10 May 2006 22:54:24 -0000 1.93
+++ demux_ogg.c 13 May 2006 05:48:16 -0000 1.94
@@ -8,6 +8,7 @@
#include <string.h>
#include <assert.h>
#include <math.h>
+#include <limits.h>
#include "mp_msg.h"
#include "help_mp.h"
@@ -348,10 +349,11 @@
else if (ogg_d->vi_inited)
{
vorbis_info *vi;
+ int32_t blocksize;
// When we dump the audio, there is no vi, but we don't care of timestamp in this case
vi = &(ogg_d->vi);
- int32_t blocksize = vorbis_packet_blocksize(vi,pack) / samplesize;
+ blocksize = vorbis_packet_blocksize(vi,pack) / samplesize;
// Calculate the timestamp if the packet don't have any
if(pack->granulepos == -1) {
pack->granulepos = os->lastpos;
@@ -663,7 +665,8 @@
demux_ogg_read_packet(os,&op,context,&pts,&flags,samplesize);
if(op.granulepos >= 0) ogg_d->final_granulepos = op.granulepos;
if(index_mode == 2 && (flags || (os->vorbis && op.granulepos >= 0))) {
- ogg_d->syncpoints = (ogg_syncpoint_t*)realloc(ogg_d->syncpoints,(ogg_d->num_syncpoint+1)*sizeof(ogg_syncpoint_t));
+ if (ogg_d->num_syncpoint > SIZE_MAX / sizeof(ogg_syncpoint_t) - 1) break;
+ ogg_d->syncpoints = realloc_struct(ogg_d->syncpoints,(ogg_d->num_syncpoint+1), sizeof(ogg_syncpoint_t));
ogg_d->syncpoints[ogg_d->num_syncpoint].granulepos = op.granulepos;
ogg_d->syncpoints[ogg_d->num_syncpoint].page_pos = (ogg_page_continued(page) && p == 0) ? last_pos : pos;
ogg_d->num_syncpoint++;
More information about the MPlayer-cvslog
mailing list