Fix crash of interlaced MPEG2 decoding
This commit is contained in:
committed by
Michael Niedermayer
parent
a18eff49c0
commit
99e07a4453
@ -1094,8 +1094,13 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
|||||||
s->pict_type, s->dropable);*/
|
s->pict_type, s->dropable);*/
|
||||||
|
|
||||||
if(s->codec_id != CODEC_ID_H264){
|
if(s->codec_id != CODEC_ID_H264){
|
||||||
if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=AV_PICTURE_TYPE_I){
|
if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) &&
|
||||||
av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
|
(s->pict_type!=AV_PICTURE_TYPE_I || s->picture_structure != PICT_FRAME)){
|
||||||
|
if (s->pict_type != AV_PICTURE_TYPE_I)
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
|
||||||
|
else if (s->picture_structure != PICT_FRAME)
|
||||||
|
av_log(avctx, AV_LOG_INFO, "allocate dummy last picture for field based first keyframe\n");
|
||||||
|
|
||||||
/* Allocate a dummy frame */
|
/* Allocate a dummy frame */
|
||||||
i= ff_find_unused_picture(s, 0);
|
i= ff_find_unused_picture(s, 0);
|
||||||
s->last_picture_ptr= &s->picture[i];
|
s->last_picture_ptr= &s->picture[i];
|
||||||
|
Reference in New Issue
Block a user