shithub: openh264

Download patch

ref: 7f53c29302916941ac7197677b3b7a3dc7af8f0c
parent: 52d25f544a9b5d6d47a64dee8fa3867d43ede287
author: Martin Storsjö <martin@martin.st>
date: Thu Mar 3 05:13:50 EST 2016

Fix a return value check

In 9cb4f4e8e21af, the error code returned from CheckIntraNxNPredMode
was changed - therefore, these return value checks, that look
for a specific error code, need to be updated accordingly.

This fixes crashes in DecodeCrashTestAPI.DecoderCrashTest
with some seeds.

--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -444,7 +444,7 @@
     }
 
     iFinalMode = CheckIntraNxNPredMode (&iSampleAvail[0], &iBestMode, i, false);
-    if (iFinalMode  == ERR_INVALID_INTRA4X4_MODE) {
+    if (iFinalMode == GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INVALID_INTRA4X4_MODE)) {
       return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_I4x4_PRED_MODE);
     }
 
@@ -528,7 +528,7 @@
 
     iFinalMode = CheckIntraNxNPredMode (&iSampleAvail[0], &iBestMode, i << 2, true);
 
-    if (iFinalMode  == ERR_INVALID_INTRA4X4_MODE) {
+    if (iFinalMode == GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INVALID_INTRA4X4_MODE)) {
       return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_I4x4_PRED_MODE);
     }