summaryrefslogtreecommitdiff
path: root/libavformat/sbgdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/sbgdec.c')
-rw-r--r--libavformat/sbgdec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index 30c3b49cd7..36cd8a3ce2 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -1333,11 +1333,9 @@ static int encode_intervals(struct sbg_script *s, AVCodecContext *avc,
if (edata_size < 0)
return AVERROR(ENOMEM);
}
- edata = av_malloc(edata_size);
- if (!edata)
+ if (ff_alloc_extradata(avc, edata_size))
return AVERROR(ENOMEM);
- avc->extradata = edata;
- avc->extradata_size = edata_size;
+ edata = avc->extradata;
#define ADD_EDATA32(v) do { AV_WL32(edata, (v)); edata += 4; } while(0)
#define ADD_EDATA64(v) do { AV_WL64(edata, (v)); edata += 8; } while(0)