* commit '3b199d29cd597a3518136d78860e172060b9e83d': lavc decoders: properly initialize AVFrame. Conflicts: libavcodec/avs.c libavcodec/c93.c libavcodec/cinepak.c libavcodec/flashsv.c libavcodec/flicvideo.c libavcodec/iff.c libavcodec/mmvideo.c libavcodec/msrle.c libavcodec/msvideo1.c libavcodec/qtrle.c libavcodec/rpza.c libavcodec/smacker.c libavcodec/smc.c libavcodec/tiertexseqv.c libavcodec/truemotion1.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n2.0
| @@ -160,10 +160,10 @@ avs_decode_frame(AVCodecContext * avctx, | |||||
| static av_cold int avs_decode_init(AVCodecContext * avctx) | static av_cold int avs_decode_init(AVCodecContext * avctx) | ||||
| { | { | ||||
| AvsContext *const avs = avctx->priv_data; | |||||
| AvsContext *s = avctx->priv_data; | |||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&avs->picture); | |||||
| avcodec_set_dimensions(avctx, 318, 198); | avcodec_set_dimensions(avctx, 318, 198); | ||||
| avcodec_get_frame_defaults(&s->picture); | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -48,11 +48,10 @@ typedef enum { | |||||
| static av_cold int decode_init(AVCodecContext *avctx) | static av_cold int decode_init(AVCodecContext *avctx) | ||||
| { | { | ||||
| C93DecoderContext * const c93 = avctx->priv_data; | |||||
| avcodec_get_frame_defaults(&c93->pictures[0]); | |||||
| avcodec_get_frame_defaults(&c93->pictures[1]); | |||||
| C93DecoderContext *s = avctx->priv_data; | |||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&s->pictures[0]); | |||||
| avcodec_get_frame_defaults(&s->pictures[1]); | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -320,6 +320,7 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx) | |||||
| }else | }else | ||||
| memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64); | memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64); | ||||
| avcodec_get_frame_defaults(&s->picture); | |||||
| avctx->coded_frame = &s->picture; | avctx->coded_frame = &s->picture; | ||||
| s->avctx = avctx; | s->avctx = avctx; | ||||
| avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; | avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; | ||||
| @@ -116,7 +116,6 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| avctx->pix_fmt = AV_PIX_FMT_BGR24; | avctx->pix_fmt = AV_PIX_FMT_BGR24; | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -142,7 +142,6 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| s->new_palette = 0; | s->new_palette = 0; | ||||
| return 0; | return 0; | ||||
| @@ -220,6 +220,8 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx) | |||||
| avctx->pix_fmt= AV_PIX_FMT_YUV410P; | avctx->pix_fmt= AV_PIX_FMT_YUV410P; | ||||
| avcodec_get_frame_defaults(&ic->picture); | |||||
| ir2_vlc.table = vlc_tables; | ir2_vlc.table = vlc_tables; | ||||
| ir2_vlc.table_allocated = 1 << CODE_VLC_BITS; | ir2_vlc.table_allocated = 1 << CODE_VLC_BITS; | ||||
| #ifdef BITSTREAM_READER_LE | #ifdef BITSTREAM_READER_LE | ||||
| @@ -62,6 +62,7 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) | |||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -71,7 +71,6 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| if (avctx->extradata_size >= 4) | if (avctx->extradata_size >= 4) | ||||
| for (i = 0; i < FFMIN(avctx->extradata_size, AVPALETTE_SIZE)/4; i++) | for (i = 0; i < FFMIN(avctx->extradata_size, AVPALETTE_SIZE)/4; i++) | ||||
| @@ -73,7 +73,6 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -324,6 +324,8 @@ static av_cold int decode_init(AVCodecContext *avctx){ | |||||
| decode_flush(avctx); | decode_flush(avctx); | ||||
| avcodec_get_frame_defaults(&a->pic); | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -397,7 +397,6 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -240,7 +240,6 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) | |||||
| avctx->pix_fmt = AV_PIX_FMT_RGB555; | avctx->pix_fmt = AV_PIX_FMT_RGB555; | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -534,7 +534,6 @@ static av_cold int decode_init(AVCodecContext *avctx) | |||||
| c->avctx = avctx; | c->avctx = avctx; | ||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&c->pic); | avcodec_get_frame_defaults(&c->pic); | ||||
| /* decode huffman trees from extradata */ | /* decode huffman trees from extradata */ | ||||
| @@ -418,7 +418,6 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) | |||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -218,7 +218,6 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) | |||||
| avctx->pix_fmt = AV_PIX_FMT_PAL8; | avctx->pix_fmt = AV_PIX_FMT_PAL8; | ||||
| avcodec_get_frame_defaults(&seq->frame); | avcodec_get_frame_defaults(&seq->frame); | ||||
| seq->frame.data[0] = NULL; | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -469,7 +469,6 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx) | |||||
| // avctx->pix_fmt = AV_PIX_FMT_RGB555; | // avctx->pix_fmt = AV_PIX_FMT_RGB555; | ||||
| avcodec_get_frame_defaults(&s->frame); | avcodec_get_frame_defaults(&s->frame); | ||||
| s->frame.data[0] = NULL; | |||||
| /* there is a vertical predictor for each pixel in a line; each vertical | /* there is a vertical predictor for each pixel in a line; each vertical | ||||
| * predictor is 0 to start with */ | * predictor is 0 to start with */ | ||||
| @@ -918,9 +918,8 @@ static av_cold int decode_init(AVCodecContext *avctx) | |||||
| } | } | ||||
| l->avctx = avctx; | l->avctx = avctx; | ||||
| l->pic.data[0] = NULL; | |||||
| avctx->pix_fmt = AV_PIX_FMT_BGR24; | |||||
| avcodec_get_frame_defaults(&l->pic); | avcodec_get_frame_defaults(&l->pic); | ||||
| avctx->pix_fmt = AV_PIX_FMT_BGR24; | |||||
| ff_dsputil_init(&l->dsp, avctx); | ff_dsputil_init(&l->dsp, avctx); | ||||
| @@ -54,6 +54,7 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) | |||||
| avctx->coded_frame = &s->frame; | avctx->coded_frame = &s->frame; | ||||
| avctx->coded_frame = (AVFrame*) &s->frame; | avctx->coded_frame = (AVFrame*) &s->frame; | ||||
| s->ulti_codebook = ulti_codebook; | s->ulti_codebook = ulti_codebook; | ||||
| avcodec_get_frame_defaults(&s->frame); | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -497,6 +497,8 @@ static av_cold int decode_init(AVCodecContext *avctx) | |||||
| return AVERROR_INVALIDDATA; | return AVERROR_INVALIDDATA; | ||||
| } | } | ||||
| avcodec_get_frame_defaults(&c->pic); | |||||
| return 0; | return 0; | ||||
| } | } | ||||