dv: add compatibility to prevent panic [1/1]
authorYi Zhou <yi.zhou@amlogic.com>
Tue, 8 Jan 2019 01:24:45 +0000 (09:24 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Tue, 8 Jan 2019 12:57:36 +0000 (20:57 +0800)
PD#SWPL-3889

Problem:
when the metadata parsed by decode is error, the array will overflow
in dv module.

Solution:
dolby type just appears once in metadata. After parsing dolby type,
breaking the circulation directly.

Verify:
U212

Change-Id: I715e28c1b9a8aab2fcb4059dd132b5b98c043f31
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c

index ee7de00..6cef2bf 100644 (file)
@@ -3757,7 +3757,6 @@ static int parse_sei_and_meta(
        || (req->aux_size == 0))
                return 1;
 
-
        p = req->aux_buf;
        while (p < req->aux_buf + req->aux_size - 8) {
                size = *p++;
@@ -3859,6 +3858,11 @@ static int parse_sei_and_meta(
                                ret = 2;
                                break;
                        }
+                       /*dolby type just appears once in metadata
+                        *after parsing dolby type,breaking the
+                        *circulation directly
+                        */
+                       break;
                }
                p += size;
        }