diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c index 37fbb5fc16..e952091714 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); }