X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsmacker.c;h=239894dad0ae1ff33eae629b522207c15b9a431c;hb=632b8298b70969f6ab43509fd276b33295d9e336;hp=8a21cc0767e400e4dd5f9cdf659f44310ee05d71;hpb=1c9ac700dd141e545538a824f5a8cb81bb0a375d;p=ffmpeg diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 8a21cc0767e..239894dad0a 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -92,7 +92,7 @@ static const uint8_t smk_pal[64] = { }; -static int smacker_probe(AVProbeData *p) +static int smacker_probe(const AVProbeData *p) { if ( AV_RL32(p->buf) != MKTAG('S', 'M', 'K', '2') && AV_RL32(p->buf) != MKTAG('S', 'M', 'K', '4')) @@ -172,8 +172,11 @@ static int smacker_read_header(AVFormatContext *s) /* init video codec */ st = avformat_new_stream(s, NULL); - if (!st) + if (!st) { + av_freep(&smk->frm_size); + av_freep(&smk->frm_flags); return AVERROR(ENOMEM); + } smk->videoindex = st->index; st->codecpar->width = smk->width; st->codecpar->height = smk->height; @@ -195,8 +198,11 @@ static int smacker_read_header(AVFormatContext *s) smk->indexes[i] = -1; if (smk->rates[i]) { ast[i] = avformat_new_stream(s, NULL); - if (!ast[i]) + if (!ast[i]) { + av_freep(&smk->frm_size); + av_freep(&smk->frm_flags); return AVERROR(ENOMEM); + } smk->indexes[i] = ast[i]->index; ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; if (smk->aflags[i] & SMK_AUD_BINKAUD) {