You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	jpeg2000: Check zero bit-plane validity
Prevent integer overflows. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
		
				
					committed by
					
						 Luca Barbato
						Luca Barbato
					
				
			
			
				
	
			
			
			
						parent
						
							7e201d575d
						
					
				
				
					commit
					17e5d614a8
				
			| @@ -652,10 +652,16 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, | ||||
|             else if (incl < 0) | ||||
|                 return incl; | ||||
|  | ||||
|             if (!cblk->npasses) | ||||
|                 cblk->nonzerobits = expn[bandno] + numgbits - 1 - | ||||
|                                     tag_tree_decode(s, prec->zerobits + cblkno, | ||||
|                                                     100); | ||||
|             if (!cblk->npasses) { | ||||
|                 int v = expn[bandno] + numgbits - 1 - | ||||
|                         tag_tree_decode(s, prec->zerobits + cblkno, 100); | ||||
|                 if (v < 0) { | ||||
|                     av_log(s->avctx, AV_LOG_ERROR, | ||||
|                            "nonzerobits %d invalid\n", v); | ||||
|                     return AVERROR_INVALIDDATA; | ||||
|                 } | ||||
|                 cblk->nonzerobits = v; | ||||
|             } | ||||
|             if ((newpasses = getnpasses(s)) < 0) | ||||
|                 return newpasses; | ||||
|             if ((llen = getlblockinc(s)) < 0) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user