]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g2meet.c
Merge commit '97d35fa89f73468d64f663bfc0686aa6cddd8b6a'
[ffmpeg] / libavcodec / g2meet.c
index 99d4d1ec37b266dce2bf68bc0a4169e346885d4d..ccccf218346dfeec6e5773d2ba57303cc7638cba 100644 (file)
@@ -453,7 +453,7 @@ static int g2m_init_buffers(G2MContext *c)
     if (!c->synth_tile || !c->jpeg_tile ||
         c->old_tile_w < c->tile_width ||
         c->old_tile_h < c->tile_height) {
-        c->tile_stride = FFALIGN(c->tile_width * 3, 16);
+        c->tile_stride = FFALIGN(c->tile_width, 16) * 3;
         aligned_height = FFALIGN(c->tile_height,    16);
         av_free(c->synth_tile);
         av_free(c->jpeg_tile);
@@ -490,7 +490,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) {
@@ -516,11 +516,6 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
         return AVERROR_PATCHWELCOME;
     }
 
-    if (cursor_fmt == 1 && cursor_w % 32) {
-        avpriv_report_missing_feature(avctx, "odd monochrome cursor width %d", cursor_w);
-        return AVERROR_PATCHWELCOME;
-    }
-
     tmp = av_realloc(c->cursor, cursor_stride * cursor_h);
     if (!tmp) {
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate cursor buffer\n");
@@ -807,10 +802,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
         c->got_header = 1;
 
     if (c->width && c->height && c->framebuf) {
-        if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
             return ret;
-        }
 
         pic->key_frame = got_header;
         pic->pict_type = got_header ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;