shithub: openh264

Download patch

ref: 2e6c9f7cd3761d27ae1dbf552fab14fe0150c2e6
parent: d35647ec3b924cb45c5e7c45d1bf437d4c962638
parent: 5a9c6db33559f2dd1bb55731914d36265c9200e0
author: HaiboZhu <[email protected]>
date: Wed Jun 15 06:31:53 EDT 2016

Merge pull request #2496 from saamas/processing-relax-downsample-buffer-size-requirement

[Processing] Relax downsample buffer size requirement

--- a/codec/processing/src/downsample/downsample.cpp
+++ b/codec/processing/src/downsample/downsample.cpp
@@ -149,7 +149,7 @@
   if (iSrcWidthY <= iDstWidthY || iSrcHeightY <= iDstHeightY) {
     return RET_INVALIDPARAM;
   }
-  if (iSrcWidthY > MAX_SAMPLE_WIDTH || iSrcHeightY > MAX_SAMPLE_HEIGHT || m_bNoSampleBuffer) {
+  if ((iSrcWidthY >> 1) > MAX_SAMPLE_WIDTH || (iSrcHeightY >> 1) > MAX_SAMPLE_HEIGHT || m_bNoSampleBuffer) {
     if ((iSrcWidthY >> 1) == iDstWidthY && (iSrcHeightY >> 1) == iDstHeightY) {
       // use half average functions
       DownsampleHalfAverage ((uint8_t*)pDstPixMap->pPixel[0], pDstPixMap->iStride[0],