Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranatoly <anatoly.nenashev at>2011-02-22 12:04:50 +0300
committerMichael Niedermayer <michaelni@gmx.at>2011-05-12 00:10:56 +0400
commit99e07a4453732058df90885f80b3db3b4f37cb3c (patch)
tree251b5fabe7bccd90e73388770a78eb8b456a2e47 /libavcodec/mpegvideo.c
parenta18eff49c03622c628913d0199dfa61e5c29f0d6 (diff)
Fix crash of interlaced MPEG2 decoding
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 50c99f4a82..6bb35f9f39 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1094,8 +1094,13 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->pict_type, s->dropable);*/
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){
- av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
+ if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) &&
+ (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 */
i= ff_find_unused_picture(s, 0);
s->last_picture_ptr= &s->picture[i];