Hi,

2014-08-18 21:49 GMT+02:00 Michael Niedermayer <michae...@gmx.at>:
> +    int max_slice_size = (ctx->frame_size_upper_bound - 200) / 
> (ctx->pictures_per_frame * ctx->slices_per_picture + 1);

Regarding the reallocation check:
pkt_size <= buf - orig_buf + 2 * max_slice_size
For last slice, pkt_size would be (N+1)*max_slice_size ideally, and
(buf - orig_buf) would be around (N-1)*max_slice_size. Then the check
is ok.

However, reallocation increases allocated size by:
int delta = 200 + ctx->pictures_per_frame *
                                ctx->slices_per_picture * max_slice_size -
                                pkt_size;

In the same fashion, shouldn't delta computation be updated to be:
200 + (ctx->pictures_per_frame * ctx->slices_per_picture + 1) * etc ?

-- 
Christophe
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to