0013-codec-avcodec-check-avcodec-visible-sizes.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. From 6cc73bcad19da2cd2e95671173f2e0d203a57e9b Mon Sep 17 00:00:00 2001
  2. From: Francois Cartegnie <fcvlcdev@free.fr>
  3. Date: Thu, 29 Jun 2017 09:45:20 +0200
  4. Subject: [PATCH] codec: avcodec: check avcodec visible sizes
  5. refs #18467
  6. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  7. ---
  8. modules/codec/avcodec/video.c | 6 ++++--
  9. 1 file changed, 4 insertions(+), 2 deletions(-)
  10. diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
  11. index 1bcad21..ce52544 100644
  12. --- a/modules/codec/avcodec/video.c
  13. +++ b/modules/codec/avcodec/video.c
  14. @@ -137,9 +137,11 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
  15. }
  16. - if( width == 0 || height == 0 || width > 8192 || height > 8192 )
  17. + if( width == 0 || height == 0 || width > 8192 || height > 8192 ||
  18. + width < p_context->width || height < p_context->height )
  19. {
  20. - msg_Err( p_dec, "Invalid frame size %dx%d.", width, height );
  21. + msg_Err( p_dec, "Invalid frame size %dx%d. vsz %dx%d",
  22. + width, height, p_context->width, p_context->height );
  23. return NULL; /* invalid display size */
  24. }
  25. p_dec->fmt_out.video.i_width = width;
  26. --
  27. 2.1.4