Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 064de8b1 authored by Apoorv Raghuvanshi's avatar Apoorv Raghuvanshi Committed by Gerrit - the friendly Code Review server
Browse files

mm-audio: aenc-aac: fix integer overflow for encoded buffer timestamp calculation

Encoded buffer timestamp is 64 bit wide and is derived by multiplying
two 32 bit values, while calculating timestamp, these values are
multiplied with result stored in intermediate storage of 32 bit used
by compiler internally, this was associated with overflow if the result
is larger than max supported by 32 bit storage.
Changing m_frame_count to 64 bit will fix possible overflow for frame
count as well as force compiler to use intermediate variable of
required size.

Change-Id: I5ab709094d1c6b984d27f98327d3d8afa179fc92
CRs-Fixed: 767185
parent e1785b18
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ private:
    unsigned int                   m_flags;      //encapsulate the waiting states.
    OMX_U64                        nTimestamp;
    OMX_U64                        ts;
    uint32_t                       m_frame_count;
    OMX_U64                        m_frame_count;
    unsigned int                   frameduration;
    unsigned int                   pcm_input; //tunnel or non-tunnel
    unsigned int                   m_inp_act_buf_count;    // Num of Input Buffers