1From 84b1919124884232e0fa30b30458470db27c73fc Mon Sep 17 00:00:00 2001 2From: James Cowgill <jcowgill@debian.org> 3Date: Sat, 18 Aug 2018 12:56:38 +0200 4Subject: [PATCH] Use AV_INPUT_BUFFER_PADDING_SIZE to determine padding 5 size 6 7Hardcoding the value for FF_INPUT_BUFFER_PADDING_SIZE is not safe 8because upstream FFmpeg might change it (as they did in FFmpeg 4.0). 9 10Instead, use FFmpeg's AV_INPUT_BUFFER_PADDING_SIZE if available and 11only hardcode a value if FFmpeg is disabled (in which case the value 12doesn't particularly matter anyway). For compatibility with older 13FFmpeg versions, define AV_INPUT_BUFFER_PADDING_SIZE if hasn't been 14defined yet. 15 16Downloaded from 17https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901735 18 19Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> 20[Fabrice: updated for 4.3.1] 21Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 22--- 23 src/utils/ffmpeg-priv.h | 4 ++++ 24 src/videofilters/nowebcam.c | 4 ++-- 25 2 files changed, 6 insertions(+), 2 deletions(-) 26 27diff --git a/src/utils/ffmpeg-priv.h b/src/utils/ffmpeg-priv.h 28index c0745a9a..d59ea0e1 100644 29--- a/src/utils/ffmpeg-priv.h 30+++ b/src/utils/ffmpeg-priv.h 31@@ -102,6 +102,10 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, 32 #endif 33 #endif 34 35+#ifndef AV_INPUT_BUFFER_PADDING_SIZE 36+#define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE 37+#endif 38+ 39 #ifndef HAVE_FUN_avcodec_encode_video2 40 int avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); 41 #endif 42-- 432.18.0 44 45