avcodec/vc2enc: Check for non negative slice bounds
Fixes: invalid shifts Fixes: Ticket 8221 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		
							parent
							
								
									7af1a3cebe
								
							
						
					
					
						commit
						f7862e8268
					
				| @ -982,6 +982,8 @@ static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     s->slice_min_bytes = s->slice_max_bytes - s->slice_max_bytes*(s->tolerance/100.0f); |     s->slice_min_bytes = s->slice_max_bytes - s->slice_max_bytes*(s->tolerance/100.0f); | ||||||
|  |     if (s->slice_min_bytes < 0) | ||||||
|  |         return AVERROR(EINVAL); | ||||||
| 
 | 
 | ||||||
|     ret = encode_frame(s, avpkt, frame, aux_data, header_size, s->interlaced); |     ret = encode_frame(s, avpkt, frame, aux_data, header_size, s->interlaced); | ||||||
|     if (ret) |     if (ret) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user