]> granicus.if.org Git - handbrake/commitdiff
deccc608sub: fix writing outside buffer
authorjstebbins <jstebbins.hb@gmail.com>
Thu, 30 Oct 2014 21:16:00 +0000 (21:16 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Thu, 30 Oct 2014 21:16:00 +0000 (21:16 +0000)
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

index 93c9cda81a929efec3ef776e6bbd8b7c475d09de..3c0ed14b816096b0be41d355ca2c99de5bca8c4c 100644 (file)
@@ -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))