summaryrefslogtreecommitdiffstats
path: root/libavcodec/samidec.c
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-11-27 14:56:32 +0800
committerClément Bœsch <u@pkh.me>2017-11-29 22:16:49 +0100
commit61bbc537ab2305392bd170a6f404ed6402bee4a8 (patch)
tree0cbeec0353b14ba5b58c51e6358dbb56ba117ac9 /libavcodec/samidec.c
parenta198c1386a4f90cd6ae06874d1cdc2e3c0891fb8 (diff)
downloadffmpeg-streaming-61bbc537ab2305392bd170a6f404ed6402bee4a8.zip
ffmpeg-streaming-61bbc537ab2305392bd170a6f404ed6402bee4a8.tar.gz
avcodec/samidec: check av_strdup() return value
In function sami_paragraph_to_ass(), the return value of av_strdup() is not checked. To avoid potential NULL dereference, the return value should be checked against NULL. Signed-off-by: Pan Bian <bianpan2016@163.com>
Diffstat (limited to 'libavcodec/samidec.c')
-rw-r--r--libavcodec/samidec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c
index 2620424..6a59806 100644
--- a/libavcodec/samidec.c
+++ b/libavcodec/samidec.c
@@ -48,6 +48,9 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
AVBPrint *dst_content = &sami->encoded_content;
AVBPrint *dst_source = &sami->encoded_source;
+ if (!dupsrc)
+ return AVERROR(ENOMEM);
+
av_bprint_clear(&sami->encoded_content);
av_bprint_clear(&sami->content);
av_bprint_clear(&sami->encoded_source);
OpenPOWER on IntegriCloud