libstagefright: Fix out of bounds error for H264 software decoder
If decoded clip's level is 1.0, InitDPB() and AVCConfigureSequence() compute different number of frames (num_fs) to allocate. InitDPB() holds an extra frame if num_fs is 1, where as AVCCS() does not. Since InitDPB() sets the state and AVCCS() allocates the buffers, num_fs - 1 buffers will be allocated. During decode, we'll attempt to access the num_fs-th frame which will be out of bounds. This fix sets AVCCS()'s copy of num_fs to be same as whatever InitDPB() computes. Change-Id: I4bb5afdb4750084f0737878445f59842cd22a6f7 CRs-Fixed: 276145
Loading
Please register or sign in to comment