vidc: vdec: consider max size between firmware and component extra data

There is a difference in extra data size calculated by component and
which comes from firmware. The difference between these two values
may come positive or negative, depends on different type of extra
data enabled at run time. In current implementation component allocate
less size then what is required in some cases which results in
abnormal termination of extra data. In this change component considers
maximum size out of there values, which covers all use cases.

Change-Id: If6861b9e7aa9708d3d3cf96e7b3bca1956bbde31
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 39e952c..87c1a1d 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -7779,6 +7779,7 @@
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
     struct v4l2_requestbuffers bufreq;
     unsigned int buf_size = 0, extra_data_size = 0, client_extra_data_size = 0;
+    unsigned int final_extra_data_size = 0;
     struct v4l2_format fmt;
     int ret = 0;
     DEBUG_PRINT_LOW("GetBufReq IN: ActCnt(%d) Size(%d)",
@@ -7874,9 +7875,11 @@
             client_extra_data_size += sizeof(OMX_OTHER_EXTRADATATYPE); //Space for terminator
             buf_size = ((buf_size + 3)&(~3)); //Align extradata start address to 64Bit
         }
-        drv_ctx.extradata_info.size = buffer_prop->actualcount * extra_data_size;
+        final_extra_data_size = (extra_data_size > client_extra_data_size ?
+            extra_data_size : client_extra_data_size);
+        drv_ctx.extradata_info.size = buffer_prop->actualcount * final_extra_data_size;
         drv_ctx.extradata_info.count = buffer_prop->actualcount;
-        drv_ctx.extradata_info.buffer_size = extra_data_size;
+        drv_ctx.extradata_info.buffer_size = final_extra_data_size;
         buf_size += client_extra_data_size;
         buf_size = (buf_size + buffer_prop->alignment - 1)&(~(buffer_prop->alignment - 1));
         DEBUG_PRINT_LOW("GetBufReq UPDATE: ActCnt(%d) Size(%d) BufSize(%d)",