[10/10] g2meet: Allocate cursor buffers large enough to fit the aligned width

Message ID 1378932481-98398-10-git-send-email-martin@martin.st
State Committed
Commit b1e469885362febce3d9a4678624e44a92f77da9
Headers show

Commit Message

Martin Storsjö Sept. 11, 2013, 8:48 p.m.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
---
 libavcodec/g2meet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Sept. 11, 2013, 9:06 p.m. | #1
On 11/09/13 22:48, Martin Storsjö wrote:
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: libav-stable@libav.org
> ---
>  libavcodec/g2meet.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Ok.

Patch

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 199e8af..1bbac2d 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -488,7 +488,7 @@  static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
     cursor_hot_y  = bytestream2_get_byte(gb);
     cursor_fmt    = bytestream2_get_byte(gb);
 
-    cursor_stride = cursor_w * 4;
+    cursor_stride = FFALIGN(cursor_w, 32) * 4;
 
     if (cursor_w < 1 || cursor_w > 256 ||
         cursor_h < 1 || cursor_h > 256) {