diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index e242bbbd9a7403c95ec759982b79a55ed5c03e52..b366899930360c02060bed137d1d73e8cc1d7c79 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -60,7 +60,7 @@ enum OutputFormat {
 
 #define MAX_THREADS 32
 
-#define MAX_PICTURE_COUNT 32
+#define MAX_PICTURE_COUNT 34
 
 #define ME_MAP_SIZE 64
 #define ME_MAP_SHIFT 3