Changeset 5642


Ignore:
Timestamp:
Aug 17, 2017 2:48:38 AM (7 years ago)
Author:
ming
Message:

Re #1994 (misc): Prevent possible overflow in video bps calculation

File:
1 edited

Legend:

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

    r4785 r5642  
    119119            vfi->apply_fmt(vfi, &vafp); 
    120120 
    121             bps = (pj_uint32_t)vafp.framebytes * fps_num * (pj_size_t)8 / fps_denum; 
     121            bps = (pj_uint32_t)((pj_uint64_t)vafp.framebytes * fps_num * 8 / fps_denum); 
    122122            fmt->det.vid.avg_bps = fmt->det.vid.max_bps = bps; 
    123123        } 
Note: See TracChangeset for help on using the changeset viewer.