[MPlayer-cvslog] r29738 - trunk/libmpdemux/demux_mkv.c
reimar
subversion at mplayerhq.hu
Wed Sep 30 09:48:01 CEST 2009
Author: reimar
Date: Wed Sep 30 09:48:01 2009
New Revision: 29738
Log:
Check for grow_array allocation failure.
Modified:
trunk/libmpdemux/demux_mkv.c
Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c Wed Sep 30 09:45:10 2009 (r29737)
+++ trunk/libmpdemux/demux_mkv.c Wed Sep 30 09:48:01 2009 (r29738)
@@ -245,6 +245,10 @@ add_cluster_position (mkv_demuxer_t *mkv
grow_array(&mkv_d->cluster_positions, mkv_d->num_cluster_pos,
sizeof(uint64_t));
+ if (!mkv_d->cluster_positions) {
+ mkv_d->num_cluster_pos = 0;
+ return;
+ }
mkv_d->cluster_positions[mkv_d->num_cluster_pos++] = position;
}
@@ -1088,6 +1092,10 @@ demux_mkv_read_cues (demuxer_t *demuxer)
&& pos != EBML_UINT_INVALID)
{
grow_array(&mkv_d->indexes, mkv_d->num_indexes, sizeof(mkv_index_t));
+ if (!mkv_d->indexes) {
+ mkv_d->num_indexes = 0;
+ break;
+ }
mkv_d->indexes[mkv_d->num_indexes].tnum = track;
mkv_d->indexes[mkv_d->num_indexes].timecode = time;
mkv_d->indexes[mkv_d->num_indexes].filepos =mkv_d->segment_start+pos;
More information about the MPlayer-cvslog
mailing list