projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f7b527
)
avformat/mpeg: check av_strdup() return value
author
Steven Liu
<lq@chinaffmpeg.org>
Thu, 10 Oct 2019 02:47:22 +0000
(10:47 +0800)
committer
Steven Liu
<lq@chinaffmpeg.org>
Sat, 19 Oct 2019 04:54:12 +0000
(06:54 +0200)
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/mpeg.c
patch
|
blob
|
history
diff --git
a/libavformat/mpeg.c
b/libavformat/mpeg.c
index
bd182e4
..
df37692
100644
(file)
--- a/
libavformat/mpeg.c
+++ b/
libavformat/mpeg.c
@@
-898,6
+898,11
@@
static int vobsub_read_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *sub_st = s->streams[i];
sub_st->codecpar->extradata = av_strdup(header_str);
+ if (!sub_st->codecpar->extradata) {
+ ret = AVERROR(ENOMEM);
+ sub_st->codecpar->extradata_size = 0;
+ goto end;
+ }
sub_st->codecpar->extradata_size = header.len;
}
av_free(header_str);