diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 103244203a..11d6729195 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1896,11 +1896,13 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) for(i=0; iheight; i++) memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i, 0x80, avctx->width); - for(i=0; iheight, v_chroma_shift); i++) { - memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i, - 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i, - 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift)); + if (s->last_picture_ptr->f->data[2]) { + for(i=0; iheight, v_chroma_shift); i++) { + memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i, + 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift)); + memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i, + 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift)); + } } if(s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263){