mpegaudiodec: Validate that the number of channels fits at the given offset
This is similar to the fix in35cbc98b. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commite9d61de96c) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
		
				
					committed by
					
						
						Luca Barbato
					
				
			
			
				
	
			
			
			
						parent
						
							5358f1b507
						
					
				
				
					commit
					bacf5db196
				
			@@ -1936,7 +1936,8 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
 | 
			
		||||
 | 
			
		||||
        avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header);
 | 
			
		||||
 | 
			
		||||
        if (ch + m->nb_channels > avctx->channels) {
 | 
			
		||||
        if (ch + m->nb_channels > avctx->channels ||
 | 
			
		||||
            s->coff[fr] + m->nb_channels > avctx->channels) {
 | 
			
		||||
            av_log(avctx, AV_LOG_ERROR, "frame channel count exceeds codec "
 | 
			
		||||
                                        "channel count\n");
 | 
			
		||||
            return AVERROR_INVALIDDATA;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user