On Sat, Mar 28, 2015 at 03:14:23PM +0000, Donny Yang wrote: > Signed-off-by: Donny Yang <w...@kota.moe> [...] > - enc_row_size = deflateBound(&s->zstream, row_size); > - max_packet_size = avctx->height * (int64_t)(enc_row_size + > - ((enc_row_size + IOBUF_SIZE - 1) / > IOBUF_SIZE) * 12) > - + FF_MIN_BUFFER_SIZE; > - if (max_packet_size > INT_MAX) > - return AVERROR(ENOMEM); > - if ((ret = ff_alloc_packet2(avctx, pkt, max_packet_size)) < 0) > - return ret; [...] > + size_t max_packet_size; > + > + enc_row_size = deflateBound(&s->zstream, (avctx->width * > s->bits_per_pixel + 7) >> 3); > + max_packet_size = > + 8 + // PNGSIG > + 13 + 12 + // IHDR > + 9 + 12 + // pHYs > + 1 + 12 + // sRGB > + 32 + 12 + // cHRM > + 4 + 12 + // gAMA > + 256 * 3 + 12 + // PLTE > + 256 + 12 + // tRNS > + avctx->height * ( > + enc_row_size + > + 12 * ((enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) // 12 * > ceil(enc_row_size / IOBUF_SIZE) > + ); > + > + ret = ff_alloc_packet2(avctx, pkt, max_packet_size < FF_MIN_BUFFER_SIZE > ? FF_MIN_BUFFER_SIZE : max_packet_size);
changes to how the packet size is calculated should be in a seperate patch also all other functional changes should be seperate from a patch that primarely moves code between init/header and frame encode [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 3 "Rare item" - "Common item with rare defect or maybe just a lie" "Professional" - "'Toy' made in china, not functional except as doorstop" "Experts will know" - "The seller hopes you are not an expert"
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel