Changeset 6061


Ignore:
Timestamp:
Sep 4, 2019 9:57:56 AM (5 years ago)
Author:
nanang
Message:

Misc (re #2210): Division by zero in pjmedia_wav_player_port_get_pos(), i.e: when player has just been created (the position is 0) or when no loop is specified and player already reached EOF and stopped (the position is again 0). Thanks to Sergei Rozinov for the patch.

File:
1 edited

Legend:

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

    r5635 r6061  
    539539 
    540540    payload_pos = (pj_size_t)(fport->fpos - fport->start_data); 
    541     if (payload_pos >= fport->bufsize) 
     541    if (payload_pos == 0) 
     542        return 0; 
     543    else if (payload_pos >= fport->bufsize) 
    542544        return payload_pos - fport->bufsize + (fport->readpos - fport->buf); 
    543545    else 
Note: See TracChangeset for help on using the changeset viewer.