mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
avcodec/mpegvideo: Fix null pointer dereference with grayscale decoding with mpeg2_field_encoding.ts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
33529104e5
commit
cf31e2df08
@ -1896,11 +1896,13 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
for(i=0; i<avctx->height; i++)
|
||||
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
|
||||
0x80, avctx->width);
|
||||
for(i=0; i<FF_CEIL_RSHIFT(avctx->height, 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; i<FF_CEIL_RSHIFT(avctx->height, 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){
|
||||
|
Loading…
Reference in New Issue
Block a user