Commit a8014534 authored by Diego Biurrun's avatar Diego Biurrun

g2meet: K&R formatting cosmetics

parent f87a6e50
......@@ -379,7 +379,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
src += 3;
}
npal = *src++ + 1;
memcpy(pal, src, npal * 3); src += npal * 3;
memcpy(pal, src, npal * 3);
src += npal * 3;
if (sub_type != 2) {
for (i = 0; i < npal; i++) {
if (!memcmp(pal + i * 3, transp, 3)) {
......@@ -391,7 +392,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
if (src_end - src < 2)
return 0;
zsize = (src[0] << 8) | src[1]; src += 2;
zsize = (src[0] << 8) | src[1];
src += 2;
if (src_end - src < zsize)
return AVERROR_INVALIDDATA;
......@@ -555,16 +557,22 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
int mask_bit = !!(bits & 0x80000000);
switch (dst[0] * 2 + mask_bit) {
case 0:
dst[0] = 0xFF; dst[1] = 0x00;
dst[2] = 0x00; dst[3] = 0x00;
dst[0] = 0xFF;
dst[1] = 0x00;
dst[2] = 0x00;
dst[3] = 0x00;
break;
case 1:
dst[0] = 0xFF; dst[1] = 0xFF;
dst[2] = 0xFF; dst[3] = 0xFF;
dst[0] = 0xFF;
dst[1] = 0xFF;
dst[2] = 0xFF;
dst[3] = 0xFF;
break;
default:
dst[0] = 0x00; dst[1] = 0x00;
dst[2] = 0x00; dst[3] = 0x00;
dst[0] = 0x00;
dst[1] = 0x00;
dst[2] = 0x00;
dst[3] = 0x00;
}
dst += 4;
bits <<= 1;
......@@ -730,7 +738,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
c->bpp = bytestream2_get_byte(&bc);
if (c->bpp == 32) {
if (bytestream2_get_bytes_left(&bc) < 16 ||
(chunk_size - 21) < 16 ) {
(chunk_size - 21) < 16) {
av_log(avctx, AV_LOG_ERROR,
"Display info: missing bitmasks!\n");
return AVERROR_INVALIDDATA;
......@@ -841,15 +849,18 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
return buf_size;
header_fail:
c->width = c->height = 0;
c->tiles_x = c->tiles_y = 0;
c->width =
c->height = 0;
c->tiles_x =
c->tiles_y = 0;
return ret;
}
static av_cold int g2m_decode_init(AVCodecContext *avctx)
{
G2MContext * const c = avctx->priv_data;
G2MContext *const c = avctx->priv_data;
int ret;
if ((ret = jpg_init(avctx, &c->jc)) != 0) {
......@@ -865,7 +876,7 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
static av_cold int g2m_decode_end(AVCodecContext *avctx)
{
G2MContext * const c = avctx->priv_data;
G2MContext *const c = avctx->priv_data;
jpg_free_context(&c->jc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment