diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index f83edf1144..4665c92ff6 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -249,6 +249,8 @@ static int decode_frame(AVCodecContext *avctx, static av_cold int sgi_init(AVCodecContext *avctx){ SgiState *s = avctx->priv_data; + s->avctx = avctx; + avcodec_get_frame_defaults(&s->picture); avctx->coded_frame = &s->picture; @@ -265,15 +267,6 @@ static av_cold int sgi_end(AVCodecContext *avctx) return 0; } -static av_cold int sgi_decode_init(AVCodecContext *avctx) -{ - SgiState *s = avctx->priv_data; - - s->avctx = avctx; - - return 0; -} - AVCodec ff_sgi_decoder = { .name = "sgi", .type = AVMEDIA_TYPE_VIDEO, @@ -283,6 +276,5 @@ AVCodec ff_sgi_decoder = { .close = sgi_end, .decode = decode_frame, .long_name = NULL_IF_CONFIG_SMALL("SGI image"), - .init = sgi_decode_init, .capabilities = CODEC_CAP_DR1, };