mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
avformat/flacdec: Reorder allocations to avoid leak on error
Fixes Coverity issue #1591795. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
59b1838e09
commit
b50c5d0290
@ -283,12 +283,6 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
|
|||||||
if (avio_seek(s->pb, *ppos, SEEK_SET) < 0)
|
if (avio_seek(s->pb, *ppos, SEEK_SET) < 0)
|
||||||
return AV_NOPTS_VALUE;
|
return AV_NOPTS_VALUE;
|
||||||
|
|
||||||
parser = av_parser_init(st->codecpar->codec_id);
|
|
||||||
if (!parser){
|
|
||||||
return AV_NOPTS_VALUE;
|
|
||||||
}
|
|
||||||
parser->flags |= PARSER_FLAG_USE_CODEC_TS;
|
|
||||||
|
|
||||||
if (!flac->parser_dec) {
|
if (!flac->parser_dec) {
|
||||||
flac->parser_dec = avcodec_alloc_context3(NULL);
|
flac->parser_dec = avcodec_alloc_context3(NULL);
|
||||||
if (!flac->parser_dec)
|
if (!flac->parser_dec)
|
||||||
@ -299,6 +293,11 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parser = av_parser_init(st->codecpar->codec_id);
|
||||||
|
if (!parser)
|
||||||
|
return AV_NOPTS_VALUE;
|
||||||
|
parser->flags |= PARSER_FLAG_USE_CODEC_TS;
|
||||||
|
|
||||||
for (;;){
|
for (;;){
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
int size;
|
int size;
|
||||||
|
Loading…
Reference in New Issue
Block a user