mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/oggparseopus: Check opus_duration() return value
Regression since39d11d599c
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 commitc619e14c31
)
This commit is contained in:
parent
64908f70e4
commit
fc82ba06ee
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue