Changeset 276:4667540927be in verona


Ignore:
Timestamp:
Aug 23, 2011 2:35:51 PM (22 months ago)
Author:
laurent <laurent@…>
Branch:
default
Message:

deallocation video struct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phapi/phms_videostream.c

    r275 r276  
    140140                pvs->frame_event.frame_remote = (phPicture_t *)malloc(sizeof(phPicture_t)); 
    141141                pvs->frame_event.frame_remote = (phPicture_t *)malloc(sizeof(phPicture_t)); 
    142                 pvs->frame_event.frame_local->width = pvs->frame_event.frame_remote->width = width; 
    143                 pvs->frame_event.frame_local->height = pvs->frame_event.frame_remote->height = height; 
     142                pvs->frame_event.frame_local->width = pvs->frame_event.frame_remote->width = 0; 
     143                pvs->frame_event.frame_local->height = pvs->frame_event.frame_remote->height = 0; 
    144144                pvs->frame_event.frame_local->planes[0] = NULL; 
    145145                pvs->frame_event.frame_remote->planes[0] = NULL; 
     
    675675#endif 
    676676         
    677         free(pvs->frame_event.frame_local); 
    678         free(pvs->frame_event.frame_remote); 
    679  
     677        if(pvs->frame_event.frame_local) 
     678        { 
     679                if(pvs->frame_event.frame_local->planes[0]) 
     680                        free(pvs->frame_event.frame_local->planes[0]); 
     681                 
     682                free(pvs->frame_event.frame_local); 
     683        } 
     684         
     685        if(pvs->frame_event.frame_remote) 
     686        { 
     687                if(pvs->frame_event.frame_remote->planes[0]) 
     688                        free(pvs->frame_event.frame_remote->planes[0]); 
     689                 
     690                free(pvs->frame_event.frame_remote); 
     691        } 
    680692} 
    681693 
Note: See TracChangeset for help on using the changeset viewer.