You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	indeo2: fail if input buffer too small
This commit is contained in:
		| @@ -156,6 +156,13 @@ static int ir2_decode_frame(AVCodecContext *avctx, | ||||
|         return -1; | ||||
|     } | ||||
|  | ||||
|     start = 48; /* hardcoded for now */ | ||||
|  | ||||
|     if (start >= buf_size) { | ||||
|         av_log(s->avctx, AV_LOG_ERROR, "input buffer size too small (%d)\n", buf_size); | ||||
|         return AVERROR_INVALIDDATA; | ||||
|     } | ||||
|  | ||||
|     s->decode_delta = buf[18]; | ||||
|  | ||||
|     /* decide whether frame uses deltas or not */ | ||||
| @@ -163,7 +170,6 @@ static int ir2_decode_frame(AVCodecContext *avctx, | ||||
|     for (i = 0; i < buf_size; i++) | ||||
|         buf[i] = av_reverse[buf[i]]; | ||||
| #endif | ||||
|     start = 48; /* hardcoded for now */ | ||||
|  | ||||
|     init_get_bits(&s->gb, buf + start, (buf_size - start) * 8); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user