libmix: check if new width/height equel to 0 when resolution change happens

BZ: 29395

If new width or height equel to 0, we don't treat it as resolution change, as there
may some issues happen, we try to use old resolution to continue decode

Change-Id: I9460f1350f0851c2b4e018b80ea7763f62fe4192
Signed-off-by: Weian Chen <weian.chen@intel.com>
Reviewed-on: http://android.intel.com:8080/41858
Reviewed-by: Qiu, Junhai <junhai.qiu@intel.com>
Reviewed-by: Ding, Haitao <haitao.ding@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index 2fd539f..dff124e 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -603,8 +603,9 @@
     ITRACE("updateFormatInfo: current size: %d x %d, new size: %d x %d",
         mVideoFormatInfo.width, mVideoFormatInfo.height, width, height);
 
-    if (mVideoFormatInfo.width != width ||
-        mVideoFormatInfo.height!= height) {
+    if ((mVideoFormatInfo.width != width ||
+        mVideoFormatInfo.height != height) &&
+        width && height) {
         mVideoFormatInfo.width = width;
         mVideoFormatInfo.height = height;
         mSizeChanged = true;
diff --git a/videodecoder/VideoDecoderMPEG4.cpp b/videodecoder/VideoDecoderMPEG4.cpp
index d8243be..cce2e64 100644
--- a/videodecoder/VideoDecoderMPEG4.cpp
+++ b/videodecoder/VideoDecoderMPEG4.cpp
@@ -516,8 +516,10 @@
         data->codec_data.video_object_layer_width,
         data->codec_data.video_object_layer_height);
 
-    if (mVideoFormatInfo.width != (int32_t)data->codec_data.video_object_layer_width ||
-        mVideoFormatInfo.height != (int32_t)data->codec_data.video_object_layer_height) {
+    if ((mVideoFormatInfo.width != (int32_t)data->codec_data.video_object_layer_width ||
+        mVideoFormatInfo.height != (int32_t)data->codec_data.video_object_layer_height) &&
+        data->codec_data.video_object_layer_width &&
+        data->codec_data.video_object_layer_height) {
         // update  encoded image size
         mVideoFormatInfo.width = data->codec_data.video_object_layer_width;
         mVideoFormatInfo.height = data->codec_data.video_object_layer_height;
diff --git a/videodecoder/VideoDecoderWMV.cpp b/videodecoder/VideoDecoderWMV.cpp
index b32edf4..85a0d28 100644
--- a/videodecoder/VideoDecoderWMV.cpp
+++ b/videodecoder/VideoDecoderWMV.cpp
@@ -401,8 +401,10 @@
         mVideoFormatInfo.width, mVideoFormatInfo.height,
         data->se_data->CODED_WIDTH, data->se_data->CODED_HEIGHT);
 
-    if (mVideoFormatInfo.width != data->se_data->CODED_WIDTH ||
-        mVideoFormatInfo.height!= data->se_data->CODED_HEIGHT) {
+    if ((mVideoFormatInfo.width != data->se_data->CODED_WIDTH ||
+        mVideoFormatInfo.height != data->se_data->CODED_HEIGHT) &&
+        data->se_data->CODED_WIDTH &&
+        data->se_data->CODED_HEIGHT) {
         // encoded image size
         mVideoFormatInfo.width = data->se_data->CODED_WIDTH;
         mVideoFormatInfo.height = data->se_data->CODED_HEIGHT;