On 2/17/12, Kostya Shishkov <[email protected]> wrote: > On Thu, Feb 16, 2012 at 09:48:57PM +0000, Paul B Mahol wrote: >> There may be extra padding at and of chunk. >> >> Signed-off-by: Paul B Mahol <[email protected]> >> --- >> libavformat/cdxl.c | 18 +++++++++++------- >> 1 files changed, 11 insertions(+), 7 deletions(-) >> >> diff --git a/libavformat/cdxl.c b/libavformat/cdxl.c >> index f2956dd..49077b4 100644 >> --- a/libavformat/cdxl.c >> +++ b/libavformat/cdxl.c >> @@ -62,9 +62,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket >> *pkt) >> { >> CDXLDemuxContext *cdxl = s->priv_data; >> AVIOContext *pb = s->pb; >> - uint32_t current_size; >> - uint16_t audio_size, palette_size; >> - int32_t video_size; >> + uint32_t current_size, video_size, image_size; >> + uint16_t audio_size, palette_size, width, height; >> int64_t pos; >> int ret; >> >> @@ -81,14 +80,17 @@ static int cdxl_read_packet(AVFormatContext *s, >> AVPacket *pkt) >> } >> >> current_size = AV_RB32(&cdxl->header[2]); >> + width = AV_RB16(&cdxl->header[14]); >> + height = AV_RB16(&cdxl->header[16]); >> palette_size = AV_RB16(&cdxl->header[20]); >> audio_size = AV_RB16(&cdxl->header[22]); >> + image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8; > > really? Usually it's FFALIGN(width * bpp, 8 or 16) / 8 * height
plane width is padded and bpp have nothing to do with this. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
