[Palette] Fix partial colormap memcpy

Colormap memcpy must copy the entire colormap not just the visible
pixels

Change-Id: Ia2d5ab8684227f4f263b8396cf432c27c328bb47
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 7ea0319..0693b36 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -3193,7 +3193,7 @@
 
   if (best_mbmi->palette_mode_info.palette_size[0] > 0) {
     memcpy(color_map, best_palette_color_map,
-           rows * cols * sizeof(best_palette_color_map[0]));
+           block_width * block_height * sizeof(best_palette_color_map[0]));
   }
   *mbmi = *best_mbmi;
   return rate_overhead;
@@ -5616,7 +5616,8 @@
   }
   if (best_mbmi->palette_mode_info.palette_size[1] > 0) {
     memcpy(color_map, best_palette_color_map,
-           rows * cols * sizeof(best_palette_color_map[0]));
+           plane_block_width * plane_block_height *
+               sizeof(best_palette_color_map[0]));
   }
 }