Skip to content
Snippets Groups Projects
Commit c7368539 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

swfdec: check lens validity

parent a354839b
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -155,6 +155,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
tag = get_swf_tag(pb, &len); tag = get_swf_tag(pb, &len);
if (tag < 0) if (tag < 0)
return tag; return tag;
if (len < 0) {
av_log(s, AV_LOG_ERROR, "len %d is invalid\n", len);
return AVERROR_INVALIDDATA;
}
if (tag == TAG_VIDEOSTREAM) { if (tag == TAG_VIDEOSTREAM) {
int ch_id = avio_rl16(pb); int ch_id = avio_rl16(pb);
len -= 2; len -= 2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment