VE: fix KW issue in h263 encoder

BZ: 98594

Fix KW issue in PVSoftMPEG4Encoder

Change-Id: I980dddc82b50fbca55bc88ad6d89866f4e3d06b7
Signed-off-by: Chang Ying <ying.chang@intel.com>
Reviewed-on: http://android.intel.com:8080/111318
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videoencoder/PVSoftMPEG4Encoder.cpp b/videoencoder/PVSoftMPEG4Encoder.cpp
index 084db78..fa8ec0d 100644
--- a/videoencoder/PVSoftMPEG4Encoder.cpp
+++ b/videoencoder/PVSoftMPEG4Encoder.cpp
@@ -388,7 +388,10 @@
         if (mNumInputFrames == 0)
             LOG_I("%d %d %d\n", pvinfo->width,
                     pvinfo->height, pvinfo->lumaStride);
-        trimBuffer((uint8_t*)value, mTrimedInputData, pvinfo->width, pvinfo->height, pvinfo->lumaStride);
+        if (pvinfo != NULL)
+            trimBuffer((uint8_t*)value, mTrimedInputData, pvinfo->width, pvinfo->height, pvinfo->lumaStride);
+        else
+            LOG_E("failed to parse metadata info");
     } else {
         memcpy(mTrimedInputData, inBuffer->data,
                 (mVideoWidth * mVideoHeight * 3 ) >> 1);
@@ -450,6 +453,7 @@
         LOG_E("Failed to encode frame or get hink track at frame %lld",
                 mNumInputFrames);
         mSignalledError = true;
+        hintTrack.CodeType = 0;
         ret = ENCODE_FAIL;
     }
     LOG_I("dataLength %d\n", dataLength);