diff options
author | Marco Nelissen <marcone@google.com> | 2013-03-27 16:44:54 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2013-03-27 16:44:54 -0700 |
commit | 4a7fe9cd333c4cf533f78a074c8c2c820b94c6d2 (patch) | |
tree | fae19b2b7fde332426c347f6f12660974a4d7047 /media/libstagefright/codecs | |
parent | 59ca8040a0cfb0324c6be7dded74d02e9f5cf6e8 (diff) | |
download | frameworks_av-4a7fe9cd333c4cf533f78a074c8c2c820b94c6d2.zip frameworks_av-4a7fe9cd333c4cf533f78a074c8c2c820b94c6d2.tar.gz frameworks_av-4a7fe9cd333c4cf533f78a074c8c2c820b94c6d2.tar.bz2 |
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
Diffstat (limited to 'media/libstagefright/codecs')
-rwxr-xr-x | media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c index 53b2fd8..cc838fd 100755 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c @@ -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) |