Changeset 5864 for pjproject


Ignore:
Timestamp:
Aug 21, 2018 8:06:43 AM (10 months ago)
Author:
ming
Message:

Fixed #2139: Fix potentially incorrect buffer allocation for video port renderer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_port.c

    r5862 r5864  
    649649        const pjmedia_video_format_info *vfi; 
    650650        pjmedia_video_apply_fmt_param vafp; 
    651  
    652         vfi = pjmedia_get_video_format_info(NULL, vparam.fmt.id); 
     651        const pjmedia_vid_dev_param *vparam_src; 
     652 
     653        vparam_src = (vp->dir & PJMEDIA_DIR_RENDER)? &prm->vidparam: 
     654                     &vparam; 
     655 
     656        vfi = pjmedia_get_video_format_info(NULL, vparam_src->fmt.id); 
    653657        if (!vfi) { 
    654658            status = PJ_ENOTFOUND; 
     
    657661 
    658662        pj_bzero(&vafp, sizeof(vafp)); 
    659         vafp.size = vparam.fmt.det.vid.size; 
     663        vafp.size = vparam_src->fmt.det.vid.size; 
    660664        status = vfi->apply_fmt(vfi, &vafp); 
    661665        if (status != PJ_SUCCESS) 
Note: See TracChangeset for help on using the changeset viewer.