From 4ef28fc0df5419d3dc59b6d91fe9498ce1a1d900 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Wed, 9 May 2018 17:27:03 +0200 Subject: [PATCH] vout: android: fix possible buffer underwrite with spus --- modules/video_output/android/display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c index e779f9e939..97ebf5d479 100644 --- a/modules/video_output/android/display.c +++ b/modules/video_output/android/display.c @@ -823,6 +823,10 @@ static void SubtitleRegionToBounds(subpicture_t *subpicture, new_bounds.left = r->i_x; new_bounds.top = r->i_y; + if (new_bounds.left < 0) + new_bounds.left = 0; + if (new_bounds.top < 0) + new_bounds.top = 0; new_bounds.right = r->fmt.i_visible_width + r->i_x; new_bounds.bottom = r->fmt.i_visible_height + r->i_y; if (r == &subpicture->p_region[0])