diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index d648f09945c3c84e60136c7a0b7e07b95a7a8abe..6ab5a980da3f5ba8bf0da64810f5083d2a80fc4e 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -825,7 +825,6 @@ void ff_er_frame_end(ERContext *s)
     int threshold_part[4] = { 100, 100, 100 };
     int threshold = 50;
     int is_intra_likely;
-    int size = s->b8_stride * 2 * s->mb_height;
 
     /* We do not support ER of field pictures yet,
      * though it should not crash if enabled. */