svq3: use memmove to avoid overlap in memcpy.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c8ce750ab)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
			
			
This commit is contained in:
		@@ -790,8 +790,8 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
 | 
				
			|||||||
                    header ^ s->watermark_key);
 | 
					                    header ^ s->watermark_key);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (length > 0) {
 | 
					        if (length > 0) {
 | 
				
			||||||
            memcpy((uint8_t *) &h->gb.buffer[get_bits_count(&h->gb) >> 3],
 | 
					            memmove((uint8_t *) &h->gb.buffer[get_bits_count(&h->gb) >> 3],
 | 
				
			||||||
                   &h->gb.buffer[h->gb.size_in_bits >> 3], length - 1);
 | 
					                    &h->gb.buffer[h->gb.size_in_bits >> 3], length - 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        skip_bits_long(&h->gb, 0);
 | 
					        skip_bits_long(&h->gb, 0);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user