shithub: openh264

Download patch

ref: c1620f3868d2b7458fe1b700c174c3e222658b9f
parent: 044af8f6743f5dd1c5359efb310cf936d8470f67
author: ruil2 <[email protected]>
date: Tue May 27 12:13:24 EDT 2014

fix a bug that if..else are grouped incorrectly

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3833,12 +3833,12 @@
     int32_t iPayloadSize	= 0;
 
     if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) {	// insufficient memory in pSliceInLayer[]
-      if (pCtx->iActiveThreadsNum == 1)
+      if (pCtx->iActiveThreadsNum == 1) {
         if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) //only single thread support re-alloc now
           return ENC_RETURN_MEMALLOCERR;
-        else if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
-          return ENC_RETURN_MEMALLOCERR;
-        }
+      } else if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
+        return ENC_RETURN_MEMALLOCERR;
+      }
     }
 
     if (kbNeedPrefix) {