[libav-commits] rtmppkt: Make pkt->data reallocable

Martin Storsjö git at libav.org
Fri Nov 28 09:03:11 CET 2014

Module: libav
Branch: master
Commit: 44127b157e9f8acb837d4bb3a094f56b40da3ef5

Author:    Martin Storsjö <martin at martin.st>
Committer: Martin Storsjö <martin at martin.st>
Date:      Mon Nov 24 10:41:34 2014 +0200

rtmppkt: Make pkt->data reallocable

We try to avoid mixing av_malloc with av_realloc, since av_malloc
may be implemented with functions that can't (formally) be mixed
with the functions used in av_realloc.

Signed-off-by: Martin Storsjö <martin at martin.st>


 libavformat/rtmppkt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 37fbb5f..e952091 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -395,7 +395,7 @@ int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type,
                           int timestamp, int size)
     if (size) {
-        pkt->data = av_malloc(size);
+        pkt->data = av_realloc(NULL, size);
         if (!pkt->data)
             return AVERROR(ENOMEM);

More information about the libav-commits mailing list