diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-14 00:54:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-14 00:54:55 +0200 |
commit | db1ab7e5af6aeafb04db153828a266d1d998a78e (patch) | |
tree | 785633cabab5d383d4d9c678380f5e12404ecd0c /libavformat | |
parent | 4bde1a4a374e0cc939bbdd8260dad77432ca03c1 (diff) | |
parent | c571424c7f6276a6374e1784ce2a33d4b6a4292d (diff) | |
download | ffmpeg-streaming-db1ab7e5af6aeafb04db153828a266d1d998a78e.zip ffmpeg-streaming-db1ab7e5af6aeafb04db153828a266d1d998a78e.tar.gz |
Merge commit 'c571424c7f6276a6374e1784ce2a33d4b6a4292d'
* commit 'c571424c7f6276a6374e1784ce2a33d4b6a4292d':
asfdec: prevent memory leaks found with Coverity Scan
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asfdec_o.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index 7a5dcc0..b85e2f7 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -281,8 +281,10 @@ static int asf_read_value(AVFormatContext *s, uint8_t *name, uint16_t name_len, av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n"); } else { char buf[256]; - if (val_len > sizeof(buf)) - return AVERROR_INVALIDDATA; + if (val_len > sizeof(buf)) { + ret = AVERROR_INVALIDDATA; + goto failed; + } if ((ret = avio_read(pb, value, val_len)) < 0) goto failed; if (ret < 2 * val_len) @@ -404,8 +406,10 @@ static int asf_read_picture(AVFormatContext *s, int len) } asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st)); asf_st = asf->asf_st[asf->nb_streams]; - if (!asf_st) - return AVERROR(ENOMEM); + if (!asf_st) { + ret = AVERROR(ENOMEM); + goto fail; + } st->disposition |= AV_DISPOSITION_ATTACHED_PIC; st->codec->codec_type = asf_st->type = AVMEDIA_TYPE_VIDEO; |