summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_qt.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-26 16:34:04 +0300
committerMartin Storsjö <martin@martin.st>2013-09-26 23:13:53 +0300
commit06ebc0bf9a6401733a4ce1310325de19f631819a (patch)
tree4c7969cc52a496a94812721c7cfe887afb11b2a1 /libavformat/rtpdec_qt.c
parent1af78b865b66acb8020c54262f12aa41ad47e05c (diff)
lavf: Allocate arrays with av_realloc if they will be realloced later
Pointers returned from av_malloc can't in general be passed to av_realloc. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec_qt.c')
-rw-r--r--libavformat/rtpdec_qt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c
index 8898f050c5..bb0a73b986 100644
--- a/libavformat/rtpdec_qt.c
+++ b/libavformat/rtpdec_qt.c
@@ -179,7 +179,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
} else {
av_freep(&qt->pkt.data);
av_init_packet(&qt->pkt);
- qt->pkt.data = av_malloc(alen + FF_INPUT_BUFFER_PADDING_SIZE);
+ qt->pkt.data = av_realloc(NULL, alen + FF_INPUT_BUFFER_PADDING_SIZE);
if (!qt->pkt.data)
return AVERROR(ENOMEM);
qt->pkt.size = 0;
@@ -213,7 +213,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
pkt->stream_index = st->index;
if (qt->remaining > 0) {
av_freep(&qt->pkt.data);
- qt->pkt.data = av_malloc(qt->remaining * qt->bytes_per_frame);
+ qt->pkt.data = av_realloc(NULL, qt->remaining * qt->bytes_per_frame);
if (!qt->pkt.data) {
av_free_packet(pkt);
return AVERROR(ENOMEM);