Browse Source

avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()

Larger packets are not supported and would cause problems later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aa5169935e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.10
Michael Niedermayer 10 years ago
parent
commit
18e83992f2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/rtpdec_xiph.c

+ 1
- 1
libavformat/rtpdec_xiph.c View File

@@ -112,7 +112,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
return data->split_pkts > 0; return data->split_pkts > 0;
} }


if (len < 6) {
if (len < 6 || len > INT_MAX/2) {
av_log(ctx, AV_LOG_ERROR, "Invalid %d byte packet\n", len); av_log(ctx, AV_LOG_ERROR, "Invalid %d byte packet\n", len);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }


Loading…
Cancel
Save