Browse Source

cinepak: More correct Cinepak decoder.

change the treatment of the strip y coordinates which previously did
not follow the description (nor did it behave like the binary decoder
on files with absolute strip offsets).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
u-bo1b@0w.se Michael Niedermayer 12 years ago
parent
commit
8d1dd5bd50
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      libavcodec/cinepak.c

+ 7
- 4
libavcodec/cinepak.c View File

@@ -366,10 +366,13 @@ static int cinepak_decode (CinepakContext *s)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;


s->strips[i].id = s->data[0]; s->strips[i].id = s->data[0];
s->strips[i].y1 = y0;
s->strips[i].x1 = 0;
s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
s->strips[i].x2 = s->avctx->width;
/* zero y1 means "relative to the previous stripe" */
if (!(s->strips[i].y1 = AV_RB16 (&s->data[4])))
s->strips[i].y2 = (s->strips[i].y1 = y0) + AV_RB16 (&s->data[8]);
else
s->strips[i].y2 = AV_RB16 (&s->data[8]);
s->strips[i].x1 = AV_RB16 (&s->data[6]);
s->strips[i].x2 = AV_RB16 (&s->data[10]);


if (s->strips[i].id == 0x10) if (s->strips[i].id == 0x10)
s->frame.key_frame = 1; s->frame.key_frame = 1;


Loading…
Cancel
Save