From 507b213cd091dc713c30ea4792096a3ea5074256 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 30 Oct 2014 21:16:00 +0000 Subject: [PATCH] deccc608sub: fix writing outside buffer When the rollup mode changes, check if the baserow + rollup height goes outside the screen. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6487 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/deccc608sub.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libhb/deccc608sub.c b/libhb/deccc608sub.c index 93c9cda81..3c0ed14b8 100644 --- a/libhb/deccc608sub.c +++ b/libhb/deccc608sub.c @@ -1221,6 +1221,11 @@ static void handle_command(unsigned char c1, const unsigned char c2, wb->data608->current_visible_start_ms = get_last_pts(wb); break; case COM_ROLLUP2: + if (wb->data608->rollup_base_row + 1 < 2) + { + move_roll_up(wb, 1); + wb->data608->rollup_base_row = 1; + } if (wb->data608->mode==MODE_POPUP) { swap_visible_buffer(wb); @@ -1244,6 +1249,11 @@ static void handle_command(unsigned char c1, const unsigned char c2, wb->data608->cursor_row = wb->data608->rollup_base_row; break; case COM_ROLLUP3: + if (wb->data608->rollup_base_row + 1 < 3) + { + move_roll_up(wb, 2); + wb->data608->rollup_base_row = 2; + } if (wb->data608->mode==MODE_POPUP) { if (write_cc_buffer(wb)) @@ -1266,6 +1276,11 @@ static void handle_command(unsigned char c1, const unsigned char c2, wb->data608->cursor_row = wb->data608->rollup_base_row; break; case COM_ROLLUP4: + if (wb->data608->rollup_base_row + 1 < 4) + { + move_roll_up(wb, 3); + wb->data608->rollup_base_row = 3; + } if (wb->data608->mode==MODE_POPUP) { if (write_cc_buffer(wb)) -- 2.40.0