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

Commit 4a7fe9cd authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix valgrind error in software h264 decoder

h264bsdNextMbAddress could read past the end of an allocation, which
could conceivably result in a segfault if the allocation was at the
very end of a page.

Change-Id: Id7a0c5733d66e609f36feb0e15b2d67b9bbc0b4d
parent 59ca8040
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ u32 h264bsdNextMbAddress(u32 *pSliceGroupMap, u32 picSizeInMbs, u32 currMbAddr)

/* Variables */

    u32 i, sliceGroup, tmp;
    u32 i, sliceGroup;

/* Code */

@@ -231,11 +231,9 @@ u32 h264bsdNextMbAddress(u32 *pSliceGroupMap, u32 picSizeInMbs, u32 currMbAddr)
    sliceGroup = pSliceGroupMap[currMbAddr];

    i = currMbAddr + 1;
    tmp = pSliceGroupMap[i];
    while ((i < picSizeInMbs) && (tmp != sliceGroup))
    while ((i < picSizeInMbs) && (pSliceGroupMap[i] != sliceGroup))
    {
        i++;
        tmp = pSliceGroupMap[i];
    }

    if (i == picSizeInMbs)