diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-10-10 10:55:29 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-10-19 06:56:52 +0200 |
commit | 9f023017abedb56ed7cae9cdd888e05db7114c20 (patch) | |
tree | 36d3fb4a7df16a07bd29e3a6f589130dfef197c9 | |
parent | b1071b405d57eb980f228f1ef17a97ca69cbf53f (diff) | |
download | ffmpeg-9f023017abedb56ed7cae9cdd888e05db7114c20.tar.gz |
avformat/sapdec: check av_strdup() return value and fix memleak
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r-- | libavformat/sapdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index eddeddeaea..f8bc0d281c 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -142,6 +142,10 @@ static int sap_read_header(AVFormatContext *s) } sap->sdp = av_strdup(&recvbuf[pos]); + if (!sap->sdp) { + ret = AVERROR(ENOMEM); + goto fail; + } break; } |