Changeset 3647


Ignore:
Timestamp:
Jul 15, 2011 2:33:17 AM (8 years ago)
Author:
nanang
Message:

Misc (re #1320): fix verification of invalid/negative video device ID in videodev.c, should just returning error instead of raising assertion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/videodev.c

    r3635 r3647  
    515515        unsigned i; 
    516516 
    517         if (id == PJMEDIA_VID_INVALID_DEV) 
     517        if (id <= PJMEDIA_VID_INVALID_DEV) 
    518518            return PJMEDIA_EVID_INVDEV; 
    519519 
     
    564564    pj_status_t status; 
    565565 
    566     PJ_ASSERT_RETURN(info && id!=PJMEDIA_VID_INVALID_DEV, PJ_EINVAL); 
     566    PJ_ASSERT_RETURN(info, PJ_EINVAL); 
    567567    PJ_ASSERT_RETURN(vid_subsys.pf, PJMEDIA_EVID_INIT); 
     568 
     569    if (id <= PJMEDIA_VID_INVALID_DEV) 
     570        return PJMEDIA_EVID_INVDEV; 
    568571 
    569572    status = lookup_dev(id, &f, &index); 
     
    635638    pj_status_t status; 
    636639 
    637     PJ_ASSERT_RETURN(param && id!=PJMEDIA_VID_INVALID_DEV, PJ_EINVAL); 
     640    PJ_ASSERT_RETURN(param, PJ_EINVAL); 
    638641    PJ_ASSERT_RETURN(vid_subsys.pf, PJMEDIA_EVID_INIT); 
     642 
     643    if (id <= PJMEDIA_VID_INVALID_DEV) 
     644        return PJMEDIA_EVID_INVDEV; 
    639645 
    640646    status = lookup_dev(id, &f, &index); 
Note: See TracChangeset for help on using the changeset viewer.