avcodec/mpegvideo: Don't initialize error resilience context for encoder

It is only used for decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-23 22:29:03 +01:00
parent 4a9b460a09
commit 5de7bce12e

View File

@ -835,7 +835,7 @@ static int init_context_frame(MpegEncContext *s)
return AVERROR(ENOMEM);
memset(s->mbintra_table, 1, mb_array_size);
return ff_mpeg_er_init(s);
return s->encoding ? 0 : ff_mpeg_er_init(s);
}
static void clear_context(MpegEncContext *s)