You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avfilter/af_alimiter: Check nextpos before use
Fixes: out of array read Fixes: tickets/10744/poc11ffmpeg Found-by: Li Zeyuan and Zeng Yunxiang. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		| @@ -195,9 +195,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) | ||||
|                     int j = i % buffer_size; | ||||
|                     double ppeak = 0, pdelta; | ||||
|  | ||||
|                     for (c = 0; c < channels; c++) { | ||||
|                         ppeak = FFMAX(ppeak, fabs(buffer[nextpos[j] + c])); | ||||
|                     } | ||||
|                     if (nextpos[j] >= 0) | ||||
|                         for (c = 0; c < channels; c++) { | ||||
|                             ppeak = FFMAX(ppeak, fabs(buffer[nextpos[j] + c])); | ||||
|                         } | ||||
|                     pdelta = (limit / peak - limit / ppeak) / (((buffer_size - nextpos[j] + s->pos) % buffer_size) / channels); | ||||
|                     if (pdelta < nextdelta[j]) { | ||||
|                         nextdelta[j] = pdelta; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user