[FFmpeg-devel] [PATCH] vc1dec: add hacks to ensure static tables are initialized in open().
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Nov 27 23:45:55 CET 2012
On 27 Nov 2012, at 21:55, Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
> libavcodec/vc1dec.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> index b6d59c9..459a011 100644
> --- a/libavcodec/vc1dec.c
> +++ b/libavcodec/vc1dec.c
> @@ -5180,6 +5180,15 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
>
> if (ff_vc1_init_common(v) < 0)
> return -1;
> + // ensure static VLC tables are initialized
> + if (ff_msmpeg4_decode_init(avctx) < 0)
> + return -1;
> + if (ff_vc1_decode_init_alloc_tables(v) < 0)
> + return -1;
> + // Hack to ensure the above functions will be called
> + // again once we know all necessary settings.
> + // That this is necessary might indicate a bug.
> + ff_MPV_common_end(&v->s);
I forgot to test in valgrind...
I suspect this might cause a memleak and it's better to use the close function like in the place where we reinit the context after a resolution change.
More information about the ffmpeg-devel
mailing list