On 2/17/12, Kostya Shishkov <[email protected]> wrote: > On Thu, Feb 16, 2012 at 09:48:58PM +0000, Paul B Mahol wrote: >> Width is padded for ham encodings too. >> >> Signed-off-by: Paul B Mahol <[email protected]> >> --- >> libavcodec/cdxl.c | 13 ++++++------- >> 1 files changed, 6 insertions(+), 7 deletions(-) >> >> diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c >> index a53a001..2e21836 100644 >> --- a/libavcodec/cdxl.c >> +++ b/libavcodec/cdxl.c >> @@ -60,9 +60,9 @@ static void import_palette(CDXLVideoContext *c, uint32_t >> *new_palette) >> } >> } >> >> -static void bitplanar2chunky(CDXLVideoContext *c, int width, >> - int linesize, uint8_t *out) >> +static void bitplanar2chunky(CDXLVideoContext *c, int linesize, uint8_t >> *out) >> { >> + int padded_width = FFALIGN(c->avctx->width, 16); >> GetBitContext gb; >> int x, y, plane; >> >> @@ -70,17 +70,16 @@ static void bitplanar2chunky(CDXLVideoContext *c, int >> width, >> memset(out, 0, linesize * c->avctx->height); >> for (plane = 0; plane < c->bpp; plane++) >> for (y = 0; y < c->avctx->height; y++) >> - for (x = 0; x < width; x++) >> + for (x = 0; x < padded_width; x++) >> out[linesize * y + x] |= get_bits1(&gb) << plane; >> } >> >> static void cdxl_decode_rgb(CDXLVideoContext *c) >> { >> uint32_t *new_palette = (uint32_t *)c->frame.data[1]; >> - int padded_width = FFALIGN(c->avctx->width, 16); >> >> import_palette(c, new_palette); >> - bitplanar2chunky(c, padded_width, c->frame.linesize[0], >> c->frame.data[0]); >> + bitplanar2chunky(c, c->frame.linesize[0], c->frame.data[0]); > > second argument should be c->avctx->width instead >
No it should not, that breaks at least one sample. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
