aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorAlexandra Hájková <alexandra.khirnova@gmail.com>2015-07-17 14:17:05 +0200
committerAnton Khirnov <anton@khirnov.net>2015-07-19 09:16:28 +0200
commit0989d3ad1fbd7509815208b0a5792918492d2a68 (patch)
treebfcfabc83f99195b966afbb9bbccd0d1af79c58d /libavformat/asfdec.c
parent406627287e015ce381795e85e2557b12bf60ca35 (diff)
downloadffmpeg-0989d3ad1fbd7509815208b0a5792918492d2a68.tar.gz
asfdec: convert condition for the replicated data reading to be safer
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 371d4807ff..bb083570e0 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1133,7 +1133,7 @@ static int asf_read_multiple_payload(AVFormatContext *s, AVPacket *pkt,
} else
avio_skip(pb, 4); // reading of media object size is already done
asf_pkt->dts = avio_rl32(pb); // read presentation time
- if (asf->rep_data_len && ((asf->rep_data_len - 8) > 0))
+ if (asf->rep_data_len && (asf->rep_data_len >= 8))
avio_skip(pb, asf->rep_data_len - 8); // skip replicated data
}
pay_len = avio_rl16(pb); // payload length should be WORD
@@ -1183,7 +1183,7 @@ static int asf_read_single_payload(AVFormatContext *s, AVPacket *pkt,
} else
avio_skip(pb, 4); // skip media object size
asf_pkt->dts = avio_rl32(pb); // read presentation time
- if ((asf->rep_data_len - 8) > 0)
+ if (asf->rep_data_len >= 8)
avio_skip(pb, asf->rep_data_len - 8); // skip replicated data
offset = avio_tell(pb);