Fix DoS in NAL search

Bug: 139939283
Test: poc in bug
Change-Id: I345232790e2d351d82e9dc6973a5ef86ce513ef3
(cherry picked from commit e52410163e4829a94b7f11ee65fbb5db0d956e21)
diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c
index 16ed36b..9f634b7 100644
--- a/decoder/ihevcd_decode.c
+++ b/decoder/ihevcd_decode.c
@@ -626,6 +626,13 @@
 
         nal_ofst = ihevcd_nal_search_start_code(ps_codec->pu1_inp_bitsbuf,
                                                 ps_codec->i4_bytes_remaining);
+        /* If there is no start code found, consume the data and break */
+        if(nal_ofst == ps_codec->i4_bytes_remaining)
+        {
+            ps_codec->pu1_inp_bitsbuf += nal_ofst;
+            ps_codec->i4_bytes_remaining -= nal_ofst;
+            break;
+        }
 
         ps_codec->i4_nal_ofst = nal_ofst;
         {