diff options
author | James Almer <jamrial@gmail.com> | 2013-12-12 03:34:19 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2014-09-11 19:37:05 -0300 |
commit | fc82ba06ee87e16b65ba1a426641e3484a69da71 (patch) | |
tree | 2c6d686350f88e3bca8f24b0327985563a68a242 | |
parent | 64908f70e4362d140e288c9ee227249ef5228510 (diff) | |
download | ffmpeg-fc82ba06ee87e16b65ba1a426641e3484a69da71.tar.gz |
avformat/oggparseopus: Check opus_duration() return value
Regression since 39d11d599cd292485fe991cd22e10d7a1738b3bc
os->pduration would be wrongly assigned a negative value on invalid packets
instead of aborting.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c619e14c314b44d86a8d552259afb957c0b6775d)
-rw-r--r-- | libavformat/oggparseopus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c index 6e6adcdb66..86aaaf53e0 100644 --- a/libavformat/oggparseopus.c +++ b/libavformat/oggparseopus.c @@ -108,6 +108,7 @@ static int opus_packet(AVFormatContext *avf, int idx) AVStream *st = avf->streams[idx]; struct oggopus_private *priv = os->private; uint8_t *packet = os->buf + os->pstart; + int ret; if (!os->psize) return AVERROR_INVALIDDATA; @@ -143,7 +144,10 @@ static int opus_packet(AVFormatContext *avf, int idx) os->lastdts = os->granule - duration; } - os->pduration = opus_duration(packet, os->psize); + if ((ret = opus_duration(packet, os->psize)) < 0) + return ret; + + os->pduration = ret; if (os->lastpts != AV_NOPTS_VALUE) { if (st->start_time == AV_NOPTS_VALUE) st->start_time = os->lastpts; |