aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-10 09:56:29 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-10 09:56:29 +0200
commit80fd6225907d4f3e57a3c17944f5cf4edd1000cd (patch)
tree194b6aa3eab331b2eb8cb8fc14882775c022bd91
parent8b1007ead88b99ab0d37eadcf0390970eea230ac (diff)
parent00cc10aee380f882507bac994ac469d8358d12e8 (diff)
downloadffmpeg-80fd6225907d4f3e57a3c17944f5cf4edd1000cd.tar.gz
Merge commit '00cc10aee380f882507bac994ac469d8358d12e8'
* commit '00cc10aee380f882507bac994ac469d8358d12e8': asfdec: do not skip padding if offset is above packet size - padding Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r--libavformat/asfdec_o.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 6b4216cab5..4d55777703 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1428,7 +1428,9 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
case READ_MULTI_SUB:
if (!asf->sub_left && !asf->nb_mult_left) {
asf->state = PARSE_PACKET_HEADER;
- if (!asf->return_subpayload)
+ if (!asf->return_subpayload &&
+ (avio_tell(pb) <= asf->packet_offset +
+ asf->packet_size - asf->pad_len))
avio_skip(pb, asf->pad_len); // skip padding
if (asf->packet_offset + asf->packet_size > avio_tell(pb))
avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
@@ -1438,9 +1440,10 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
case READ_MULTI:
if (!asf->nb_mult_left) {
asf->state = PARSE_PACKET_HEADER;
- if (!asf->return_subpayload) {
+ if (!asf->return_subpayload &&
+ (avio_tell(pb) <= asf->packet_offset +
+ asf->packet_size - asf->pad_len))
avio_skip(pb, asf->pad_len); // skip padding
- }
if (asf->packet_offset + asf->packet_size > avio_tell(pb))
avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
}