Ticket #526: ticket526.2.patch

File ticket526.2.patch, 1.1 KB (added by nanang, 13 years ago)

Fixed buggy patch 'ticket526.patch': posibility of accessing port after wav player port destroyed

  • pjmedia/src/pjmedia/wav_player.c

     
    498498    if (fport->eof && fport->readpos >= fport->eofpos) { 
    499499        pj_status_t status = PJ_SUCCESS; 
    500500 
     501        PJ_LOG(5,(THIS_FILE, "File port %.*s EOF", 
     502                  (int)fport->base.info.name.slen, 
     503                  fport->base.info.name.ptr)); 
     504 
    501505        /* Call callback, if any */ 
    502506        if (fport->cb) 
    503507            status = (*fport->cb)(this_port, fport->base.port_data.pdata); 
     
    507511         * it might have been destroyed by the callback). 
    508512         */ 
    509513        if ((status != PJ_SUCCESS) || (fport->options & PJMEDIA_FILE_NO_LOOP)) { 
    510             PJ_LOG(5,(THIS_FILE, "File port %.*s EOF, stopping..", 
    511                       (int)fport->base.info.name.slen, 
    512                       fport->base.info.name.ptr)); 
    513  
    514514            frame->type = PJMEDIA_FRAME_TYPE_NONE; 
    515515            frame->size = 0; 
    516516            return PJ_EEOF; 
    517517        } 
    518518         
    519         PJ_LOG(5,(THIS_FILE, "File port %.*s EOF, rewinding..", 
     519        PJ_LOG(5,(THIS_FILE, "File port %.*s rewinding..", 
    520520                  (int)fport->base.info.name.slen, 
    521521                  fport->base.info.name.ptr)); 
    522522