1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Hendrik Leppkes 2015-10-10 09:56:29 +02:00
commit 80fd622590

View File

@ -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);
}