[FFmpeg-cvslog] avformat/sapdec: check av_strdup() return value and fix memleak

Steven Liu git at videolan.org
Sat Oct 19 08:11:29 EEST 2019


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Thu Oct 10 10:55:29 2019 +0800| [9f023017abedb56ed7cae9cdd888e05db7114c20] | committer: Steven Liu

avformat/sapdec: check av_strdup() return value and fix memleak

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f023017abedb56ed7cae9cdd888e05db7114c20
---

 libavformat/sapdec.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
     }
 



More information about the ffmpeg-cvslog mailing list