mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-04 01:36:07 +00:00
avformat/qoadec: Check ffio_ensure_seekback()
Fixes Coverity issue #1598406. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
6dc8d4eea8
commit
95faf45af1
@ -41,6 +41,7 @@ static int qoa_read_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
int ret;
|
||||||
|
|
||||||
st = avformat_new_stream(s, NULL);
|
st = avformat_new_stream(s, NULL);
|
||||||
if (!st)
|
if (!st)
|
||||||
@ -52,7 +53,9 @@ static int qoa_read_header(AVFormatContext *s)
|
|||||||
st->duration = avio_rb32(pb);
|
st->duration = avio_rb32(pb);
|
||||||
st->start_time = 0;
|
st->start_time = 0;
|
||||||
|
|
||||||
ffio_ensure_seekback(pb, 4);
|
ret = ffio_ensure_seekback(pb, 4);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
st->codecpar->ch_layout.nb_channels = avio_r8(pb);
|
st->codecpar->ch_layout.nb_channels = avio_r8(pb);
|
||||||
if (st->codecpar->ch_layout.nb_channels == 0)
|
if (st->codecpar->ch_layout.nb_channels == 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user