X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Finterplayvideo.c;h=68aa966208eeb3aa1af5b9ff3f5ec6e1bb9689ee;hb=a2c419848df3e76e164bd19c3841f39d2971d326;hp=d27c9ba9c72252cb801c48eb23fa9755cb5c863c;hpb=bba6f5b77f69e0b7fb00b3f346422715fc602f55;p=ffmpeg diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index d27c9ba9c72..68aa966208e 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1019,12 +1019,10 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) dsputil_init(&s->dsp, avctx); - /* decoding map contains 4 bits of information per 8x8 block */ - s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2); - avcodec_get_frame_defaults(&s->second_last_frame); avcodec_get_frame_defaults(&s->last_frame); avcodec_get_frame_defaults(&s->current_frame); + s->current_frame.data[0] = s->last_frame.data[0] = s->second_last_frame.data[0] = NULL; @@ -1039,6 +1037,9 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, int buf_size = avpkt->size; IpvideoContext *s = avctx->priv_data; + /* decoding map contains 4 bits of information per 8x8 block */ + s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2); + /* compressed buffer needs to be large enough to at least hold an entire * decoding map */ if (buf_size < s->decoding_map_size) @@ -1099,6 +1100,6 @@ AVCodec ff_interplay_video_decoder = { .init = ipvideo_decode_init, .close = ipvideo_decode_end, .decode = ipvideo_decode_frame, - .capabilities = CODEC_CAP_DR1, + .capabilities = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE, .long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"), };