avcodec/libtheoraenc: Check for av_fast_realloc() failure
Fixes CID1257799 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							parent
							
								
									27216bf314
								
							
						
					
					
						commit
						67d4d5f5db
					
				@ -99,8 +99,11 @@ static int get_stats(AVCodecContext *avctx, int eos)
 | 
			
		||||
        return AVERROR_EXTERNAL;
 | 
			
		||||
    }
 | 
			
		||||
    if (!eos) {
 | 
			
		||||
        h->stats = av_fast_realloc(h->stats, &h->stats_size,
 | 
			
		||||
        void *tmp = av_fast_realloc(h->stats, &h->stats_size,
 | 
			
		||||
                                   h->stats_offset + bytes);
 | 
			
		||||
        if (!tmp)
 | 
			
		||||
            return AVERROR(ENOMEM);
 | 
			
		||||
        h->stats = tmp;
 | 
			
		||||
        memcpy(h->stats + h->stats_offset, buf, bytes);
 | 
			
		||||
        h->stats_offset += bytes;
 | 
			
		||||
    } else {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user