shithub: openh264

Download patch

ref: dfd24a987d728e6d05676e563f654ac70e5095e4
parent: e7fff10d9181bf2b4676556b1a77c008762bbfa7
parent: 6dcaf2f890ecd3f439629a1250796506fa2f8db9
author: sijchen <[email protected]>
date: Fri Jan 23 04:45:54 EST 2015

Merge pull request #1748 from dongzha/fixcrash

fix crash in SGE test

--- a/codec/decoder/core/inc/decoder_context.h
+++ b/codec/decoder/core/inc/decoder_context.h
@@ -421,9 +421,11 @@
 } SWelsDecoderContext, *PWelsDecoderContext;
 
 static inline void ResetActiveSPSForEachLayer (PWelsDecoderContext pCtx) {
-for (int i = 0; i < MAX_LAYER_NUM; i++) {
-  pCtx->pActiveLayerSps[i] = NULL;
-}
+  if ( pCtx->iTotalNumMbRec == 0 ) {
+    for (int i = 0; i < MAX_LAYER_NUM; i++) {
+      pCtx->pActiveLayerSps[i] = NULL;
+    }
+  }
 }
 //#ifdef __cplusplus
 //}