radeon/uvd: fix overflow error while calculating bit stream buffer size
authorIndrajit Das <indrajit-kumar.das@amd.com>
Fri, 27 May 2016 12:57:15 +0000 (18:27 +0530)
committerChristian König <christian.koenig@amd.com>
Mon, 4 Jul 2016 09:38:05 +0000 (11:38 +0200)
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_uvd.c

index 97765da69e3dc6a819164aea81d97530d4efa6e0..722341756636a0d0ed7190d671e96cc902b88b03 100644 (file)
@@ -1233,7 +1233,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context,
 
        dec->fb_size = (info.family == CHIP_TONGA) ? FB_BUFFER_SIZE_TONGA :
                        FB_BUFFER_SIZE;
-       bs_buf_size = width * height * 512 / (16 * 16);
+       bs_buf_size = width * height * (512 / (16 * 16));
        for (i = 0; i < NUM_BUFFERS; ++i) {
                unsigned msg_fb_it_size = FB_BUFFER_OFFSET + dec->fb_size;
                STATIC_ASSERT(sizeof(struct ruvd_msg) <= FB_BUFFER_OFFSET);