Commit fafd8443 authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideo: fix MB/MV vissualization on videos that are not mod 16 == 0

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6093960a
......@@ -1595,8 +1595,8 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict)
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt,
&h_chroma_shift, &v_chroma_shift);
for (i = 0; i < 3; i++) {
size_t size= (i == 0) ? pict->linesize[i] * height:
pict->linesize[i] * height >> v_chroma_shift;
size_t size= (i == 0) ? pict->linesize[i] * FFALIGN(height, 16):
pict->linesize[i] * FFALIGN(height, 16) >> v_chroma_shift;
s->visualization_buffer[i]= av_realloc(s->visualization_buffer[i], size);
memcpy(s->visualization_buffer[i], pict->data[i], size);
pict->data[i] = s->visualization_buffer[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment