adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
This was broken in095be4fb- samples+ch (for the previous non-planar case) equals &samples_p[ch][0]. The confusion probably stemmed from the IMA WAV case where it originally was &samples[avctx->channels + ch], which was correctly changed into &samples_p[ch][1]. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit3d79d0c93e) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
		
				
					committed by
					
						
						Luca Barbato
					
				
			
			
				
	
			
			
			
						parent
						
							d7dbc687e3
						
					
				
				
					commit
					744e7eea5d
				
			@@ -557,7 +557,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 | 
			
		||||
            put_bits(&pb, 7,  status->step_index);
 | 
			
		||||
            if (avctx->trellis > 0) {
 | 
			
		||||
                uint8_t buf[64];
 | 
			
		||||
                adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
 | 
			
		||||
                adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status,
 | 
			
		||||
                                       64, 1);
 | 
			
		||||
                for (i = 0; i < 64; i++)
 | 
			
		||||
                    put_bits(&pb, 4, buf[i ^ 1]);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user