diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-12-10 22:59:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-12 19:25:33 +0100 |
commit | 56ce2ad2cccf33067b9f428a637f5c11edcc10ea (patch) | |
tree | 7a698dbe9fc6dd978d27c3a0748d7421ad93d4b8 /libavformat | |
parent | a87b5d5e8c9424b5cadd46abba98dae8edd454df (diff) | |
download | ffmpeg-56ce2ad2cccf33067b9f428a637f5c11edcc10ea.tar.gz |
avformat/mov: Use ff_alloc_extradata for dvdsub extradata
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7553a7fdfc..733f4e4a34 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2255,7 +2255,7 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st) { char buf[256] = {0}; uint8_t *src = st->codecpar->extradata; - int i; + int i, ret; if (st->codecpar->extradata_size != 64) return 0; @@ -2275,12 +2275,9 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st) if (av_strlcat(buf, "\n", sizeof(buf)) >= sizeof(buf)) return 0; - av_freep(&st->codecpar->extradata); - st->codecpar->extradata_size = 0; - st->codecpar->extradata = av_mallocz(strlen(buf) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!st->codecpar->extradata) - return AVERROR(ENOMEM); - st->codecpar->extradata_size = strlen(buf); + ret = ff_alloc_extradata(st->codecpar, strlen(buf)); + if (ret < 0) + return ret; memcpy(st->codecpar->extradata, buf, st->codecpar->extradata_size); return 0; |