[libbluray-devel] Fix implicit sign extension

hpi1 git at videolan.org
Thu Aug 21 12:39:14 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Aug 21 13:33:44 2014 +0300| [0da66e99a0b82769a1749747c4dae779177132e2] | committer: hpi1

Fix implicit sign extension

Was uint16 * uint16 -> int -> size_t

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=0da66e99a0b82769a1749747c4dae779177132e2
---

 src/libbluray/decoders/graphics_controller.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 4a2f0e3..9474c9d 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -1067,9 +1067,9 @@ static int _render_textst(GRAPHICS_CONTROLLER *p, uint32_t stc, GC_NAV_CMDS *cmd
             }
 
             TEXTST_BITMAP bmp = {NULL, style->text_box.width, style->text_box.height, style->text_box.width, 0};
-            bmp.mem = malloc(bmp.width * bmp.height);
+            bmp.mem = malloc((size_t)bmp.width * bmp.height);
             if (bmp.mem) {
-                memset(bmp.mem, style->region_info.background_color, bmp.width * bmp.height);
+                memset(bmp.mem, style->region_info.background_color, (size_t)bmp.width * bmp.height);
 
                 textst_render(p->textst_render, &bmp, style, region);
 



More information about the libbluray-devel mailing list