Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 673ad5e5003adfcef01b815b60ac349fc20846c5
- Author: Michael Niedermayer <michael@niedermayer.cc>
- Date: Mon Aug 1 12:32:37 2016 +0200
- avcodec/vp9_parser: Check the input frame sizes for being consistent
- Suggested-by: BBB
- Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
- diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c
- index 2e9235e..2411b86 100644
- --- a/libavcodec/vp9_parser.c
- +++ b/libavcodec/vp9_parser.c
- @@ -89,6 +89,19 @@ static int parse(AVCodecParserContext *ctx,
- }
- if (s->n_frames > 0) {
- + int i;
- + int size_sum = 0;
- +
- + for (i=0; i<s->n_frames ; i++)
- + size_sum += s->size[i];
- + if (size_sum != size) {
- + av_log(avctx, AV_LOG_ERROR, "Inconsistent input frame sizes %d %d\n",
- + size_sum, size);
- + s->n_frames = 0;
- + }
- + }
- +
- + if (s->n_frames > 0) {
- *out_data = data;
- *out_size = s->size[--s->n_frames];
- parse_frame(ctx, *out_data, *out_size);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement