Skip to content
Snippets Groups Projects
Commit 94fd9201 authored by Mike Melanson's avatar Mike Melanson
Browse files

support Cinepak files with funky (not divisible by 4) resolutions

Originally committed as revision 2433 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8dafdb88
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,8 @@ typedef struct CinepakContext { ...@@ -68,6 +68,8 @@ typedef struct CinepakContext {
unsigned char *data; unsigned char *data;
int size; int size;
int width, height;
unsigned char palette[PALETTE_COUNT * 4]; unsigned char palette[PALETTE_COUNT * 4];
int palette_video; int palette_video;
cvid_strip_t strips[MAX_STRIPS]; cvid_strip_t strips[MAX_STRIPS];
...@@ -289,9 +291,9 @@ static int cinepak_decode_strip (CinepakContext *s, ...@@ -289,9 +291,9 @@ static int cinepak_decode_strip (CinepakContext *s,
int chunk_id, chunk_size; int chunk_id, chunk_size;
/* coordinate sanity checks */ /* coordinate sanity checks */
if (strip->x1 >= s->avctx->width || strip->x2 > s->avctx->width || if (strip->x1 >= s->width || strip->x2 > s->width ||
strip->y1 >= s->avctx->height || strip->y2 > s->avctx->height || strip->y1 >= s->height || strip->y2 > s->height ||
strip->x1 >= strip->x2 || strip->y1 >= strip->y2) strip->x1 >= strip->x2 || strip->y1 >= strip->y2)
return -1; return -1;
while ((data + 4) <= eod) { while ((data + 4) <= eod) {
...@@ -390,6 +392,8 @@ static int cinepak_decode_init(AVCodecContext *avctx) ...@@ -390,6 +392,8 @@ static int cinepak_decode_init(AVCodecContext *avctx)
*/ */
s->avctx = avctx; s->avctx = avctx;
s->width = (avctx->width + 3) & ~3;
s->height = (avctx->height + 3) & ~3;
// check for paletted data // check for paletted data
s->palette_video = 0; s->palette_video = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment