diff options
author | James Almer <jamrial@gmail.com> | 2017-11-11 00:28:53 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-11 00:28:53 -0300 |
commit | 73198aca2c27712e45f29dec769f4c343ee40c20 (patch) | |
tree | 0873ce3eae0573a4509bc132decb0edd75c3001b /libavformat/mov.c | |
parent | 27604549456282102eadbcb920b9a64775c683e1 (diff) | |
parent | defe307fb22beca60a632e976ab97e5edd4aee25 (diff) |
Merge commit 'defe307fb22beca60a632e976ab97e5edd4aee25'
* commit 'defe307fb22beca60a632e976ab97e5edd4aee25':
mov: move stsd finalization to an appropriate place
mov: Do not set stsd_count if mov_read_stsd() fails
mov: log and return early on non-positive stsd entry counts
See 8b43ee4054af799e388d380b379a13a60849c1b5
656feb641de3cd5b9cb4e33ffd3f0ad4664c36d2
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7954db6e47..5fc597ee26 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2548,15 +2548,18 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) /* Prepare space for hosting multiple extradata. */ sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); + if (!sc->extradata) + return AVERROR(ENOMEM); + sc->extradata_size = av_mallocz_array(entries, sizeof(*sc->extradata_size)); - if (!sc->extradata_size || !sc->extradata) { + if (!sc->extradata_size) { ret = AVERROR(ENOMEM); goto fail; } ret = ff_mov_read_stsd_entries(c, pb, entries); if (ret < 0) - return ret; + goto fail; sc->stsd_count = entries; |