avformat/mpegts: Check desc_len / get8() return code
[ffmpeg.git] / libavformat / mpegts.c
index 2252b44..a6b966b 100644 (file)
@@ -1994,7 +1994,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
                 break;
             desc_len = get8(&p, desc_list_end);
             desc_end = p + desc_len;
-            if (desc_end > desc_list_end)
+            if (desc_len < 0 || desc_end > desc_list_end)
                 break;
 
             av_dlog(ts->stream, "tag: 0x%02x len=%d\n",