Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.04 KB | None | 0 0
  1. commit 673ad5e5003adfcef01b815b60ac349fc20846c5
  2. Author: Michael Niedermayer <michael@niedermayer.cc>
  3. Date:   Mon Aug 1 12:32:37 2016 +0200
  4.  
  5.     avcodec/vp9_parser: Check the input frame sizes for being consistent
  6.    
  7.     Suggested-by: BBB
  8.     Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  9.  
  10. diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c
  11. index 2e9235e..2411b86 100644
  12. --- a/libavcodec/vp9_parser.c
  13. +++ b/libavcodec/vp9_parser.c
  14. @@ -89,6 +89,19 @@ static int parse(AVCodecParserContext *ctx,
  15.      }
  16.  
  17.      if (s->n_frames > 0) {
  18. +        int i;
  19. +        int size_sum = 0;
  20. +
  21. +        for (i=0; i<s->n_frames ; i++)
  22. +            size_sum += s->size[i];
  23. +        if (size_sum != size) {
  24. +            av_log(avctx, AV_LOG_ERROR, "Inconsistent input frame sizes %d %d\n",
  25. +                   size_sum, size);
  26. +            s->n_frames = 0;
  27. +        }
  28. +    }
  29. +
  30. +    if (s->n_frames > 0) {
  31.          *out_data = data;
  32.          *out_size = s->size[--s->n_frames];
  33.          parse_frame(ctx, *out_data, *out_size);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement