]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_xiph.c
Merge commit '3b73d5c942f44b37f0e44276ebcfd66c8b12c02d'
[ffmpeg] / libavformat / rtpdec_xiph.c
index 8492865b4ff3f1ec98ceff5824f8eca57a729361..eceb840580f8ff04d701bdb9224a1cdfc059de6b 100644 (file)
@@ -73,7 +73,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
         }
         pkt_len = AV_RB16(data->split_buf + data->split_pos);
         data->split_pos += 2;
-        if (data->split_pos + pkt_len > data->split_buf_len) {
+        if (pkt_len > data->split_buf_len - data->split_pos) {
             av_log(ctx, AV_LOG_ERROR, "Not enough data to return\n");
             return AVERROR_INVALIDDATA;
         }