avcodec/vqavideo: Check chunk size
Fixes CID1239154 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							parent
							
								
									ec38a1ba40
								
							
						
					
					
						commit
						8a62b80ce6
					
				@ -231,6 +231,12 @@ static int decode_format80(VqaContext *s, int src_size,
 | 
				
			|||||||
    unsigned char color;
 | 
					    unsigned char color;
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (src_size < 0 || src_size > bytestream2_get_bytes_left(&s->gb)) {
 | 
				
			||||||
 | 
					        av_log(s->avctx, AV_LOG_ERROR, "Chunk size %d is out of range\n",
 | 
				
			||||||
 | 
					               src_size);
 | 
				
			||||||
 | 
					        return AVERROR_INVALIDDATA;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    start = bytestream2_tell(&s->gb);
 | 
					    start = bytestream2_tell(&s->gb);
 | 
				
			||||||
    while (bytestream2_tell(&s->gb) - start < src_size) {
 | 
					    while (bytestream2_tell(&s->gb) - start < src_size) {
 | 
				
			||||||
        opcode = bytestream2_get_byte(&s->gb);
 | 
					        opcode = bytestream2_get_byte(&s->gb);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user