avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 12 May 2015 16:03:55 +0000 (18:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Jun 2015 21:25:20 +0000 (23:25 +0200)
Larger packets are not supported and would cause problems later

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtpdec_xiph.c

index dc34f9e..da9a1e2 100644 (file)
@@ -112,7 +112,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
         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);
         return AVERROR_INVALIDDATA;
     }