Skip to content

Commit

Permalink
ffv1enc: fix integer overflow with high resolutions and lots of slices.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Sep 29, 2012
1 parent 594b1fc commit f049729
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libavcodec/ffv1.c
Expand Up @@ -1313,9 +1313,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,

for(i=1; i<f->slice_count; i++){
FFV1Context *fs= f->slice_context[i];
uint8_t *start = pkt->data + (pkt->size-used_count)*i/f->slice_count;
uint8_t *start = pkt->data + (pkt->size-used_count)*(int64_t)i/f->slice_count;
int len = pkt->size/f->slice_count;

ff_init_range_encoder(&fs->c, start, len);
}
avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL, f->slice_count, sizeof(void*));
Expand Down

0 comments on commit f049729

Please sign in to comment.