You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	matroskaenc: check cue point validity before reallocation
Prevents memory leak and possible access to freed memory. Fixes CID605744.
This commit is contained in:
		| @@ -368,13 +368,13 @@ static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t clus | ||||
| { | ||||
|     mkv_cuepoint *entries = cues->entries; | ||||
|  | ||||
|     if (ts < 0) | ||||
|         return 0; | ||||
|  | ||||
|     entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint)); | ||||
|     if (entries == NULL) | ||||
|         return AVERROR(ENOMEM); | ||||
|  | ||||
|     if (ts < 0) | ||||
|         return 0; | ||||
|  | ||||
|     entries[cues->num_entries  ].pts = ts; | ||||
|     entries[cues->num_entries  ].tracknum = stream + 1; | ||||
|     entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user