Decoder: Add supported width check for MBaff streams

In case of MBAff streams, decoder processes two rows at a time,
this limits maximum supported width to 1920 for MBAff streams.

Bug: 33818508
Bug: 34013472
Change-Id: Iec2941f116cf3c36b63013a930319960023a3b42
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 3116d16..622eb26 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -939,6 +939,15 @@
             return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
         }
 
+        /* If MBAff is enabled, decoder support is limited to streams with
+         * width less than half of H264_MAX_FRAME_WIDTH.
+         * In case of MBAff decoder processes two rows at a time
+         */
+        if((u2_pic_wd << ps_seq->u1_mb_aff_flag) > H264_MAX_FRAME_WIDTH)
+        {
+            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
+        }
+
         ps_dec->u2_disp_height = i4_cropped_ht;
 
         ps_dec->u2_disp_width = i4_cropped_wd;