# HG changeset patch # User melanson # Date 1067095354 0 # Node ID 860e44e2c20c36c7380cfcb1778b7e359c014fbc # Parent aa4dc16c0f1891e31492a7b0448e0ec5449288a1 support Cinepak files with funky (not divisible by 4) resolutions diff -r aa4dc16c0f18 -r 860e44e2c20c cinepak.c --- a/cinepak.c Sat Oct 25 00:32:54 2003 +0000 +++ b/cinepak.c Sat Oct 25 15:22:34 2003 +0000 @@ -68,6 +68,8 @@ unsigned char *data; int size; + int width, height; + unsigned char palette[PALETTE_COUNT * 4]; int palette_video; cvid_strip_t strips[MAX_STRIPS]; @@ -289,9 +291,9 @@ int chunk_id, chunk_size; /* coordinate sanity checks */ - if (strip->x1 >= s->avctx->width || strip->x2 > s->avctx->width || - strip->y1 >= s->avctx->height || strip->y2 > s->avctx->height || - strip->x1 >= strip->x2 || strip->y1 >= strip->y2) + if (strip->x1 >= s->width || strip->x2 > s->width || + strip->y1 >= s->height || strip->y2 > s->height || + strip->x1 >= strip->x2 || strip->y1 >= strip->y2) return -1; while ((data + 4) <= eod) { @@ -390,6 +392,8 @@ */ s->avctx = avctx; + s->width = (avctx->width + 3) & ~3; + s->height = (avctx->height + 3) & ~3; // check for paletted data s->palette_video = 0;