mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
a198c1386a
commit
61bbc537ab
|
@ -48,6 +48,9 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
|
||||||
AVBPrint *dst_content = &sami->encoded_content;
|
AVBPrint *dst_content = &sami->encoded_content;
|
||||||
AVBPrint *dst_source = &sami->encoded_source;
|
AVBPrint *dst_source = &sami->encoded_source;
|
||||||
|
|
||||||
|
if (!dupsrc)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
av_bprint_clear(&sami->encoded_content);
|
av_bprint_clear(&sami->encoded_content);
|
||||||
av_bprint_clear(&sami->content);
|
av_bprint_clear(&sami->content);
|
||||||
av_bprint_clear(&sami->encoded_source);
|
av_bprint_clear(&sami->encoded_source);
|
||||||
|
|
Loading…
Reference in New Issue