You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avformat/utils: Check rfps_duration_sum for overflow
Fixes: signed integer overflow: 9151595917793558550 + 297519050751678697 cannot be represented in type 'long'
Fixes: 15496/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5722866475073536
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5c46fdf305)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
			
			
This commit is contained in:
		| @@ -3342,8 +3342,10 @@ int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t ts) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         st->info->duration_count++; | ||||
|         st->info->rfps_duration_sum += duration; | ||||
|         if (st->info->rfps_duration_sum <= INT64_MAX - duration) { | ||||
|             st->info->duration_count++; | ||||
|             st->info->rfps_duration_sum += duration; | ||||
|         } | ||||
|  | ||||
|         if (st->info->duration_count % 10 == 0) { | ||||
|             int n = st->info->duration_count; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user