diff options
author | Pan Bian <bianpan2016@163.com> | 2017-11-27 14:56:32 +0800 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-11-29 22:16:49 +0100 |
commit | 61bbc537ab2305392bd170a6f404ed6402bee4a8 (patch) | |
tree | 0cbeec0353b14ba5b58c51e6358dbb56ba117ac9 /libavcodec/samidec.c | |
parent | a198c1386a4f90cd6ae06874d1cdc2e3c0891fb8 (diff) | |
download | ffmpeg-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.c | 3 |
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); |