Commit 467d4815 authored by Simon Morlat's avatar Simon Morlat

fix crash because of virtual refbase of AudioTrack not detected properly, due...

fix crash because of virtual refbase of AudioTrack not detected properly, due to reverse loop starting past end of buffer.
parent f534803e
......@@ -239,7 +239,7 @@ ptrdiff_t findRefbaseOffset(void *obj, size_t size){
ms_warning("findRefbaseOffset(): no base vptr");
}
ms_message("base_vptr is %p for obj %p",base_vptr, obj);
for (i=(size/sizeof(void*))*sizeof(void*);i>0;i-=sizeof(void*)){
for (i=((size/sizeof(void*))-1)*sizeof(void*);i>0;i-=sizeof(void*)){
uint8_t *ptr= ((uint8_t*)obj) + i;
uint8_t *candidate=(uint8_t*)*(void**)ptr;
if (i!=0 && labs((ptrdiff_t)(candidate-base_vptr))<vptrMemRange){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment