[FFmpeg-cvslog] avcodec/avpacket: use av_malloc() to allocate an AVPacket

James Almer git at videolan.org
Sun May 9 00:44:37 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat May  8 18:36:28 2021 -0300| [b4e7fc4b4b4aa71ae6806b57ebe1293239497f71] | committer: James Almer

avcodec/avpacket: use av_malloc() to allocate an AVPacket

av_mallocz() is superfluous as get_packet_defaults() is called immediately
after it's allocated, which will initialize the entire struct to default
values.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4e7fc4b4b4aa71ae6806b57ebe1293239497f71
---

 libavcodec/avpacket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 1f20cd1e6b..7383d12d3e 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -58,7 +58,7 @@ static void get_packet_defaults(AVPacket *pkt)
 
 AVPacket *av_packet_alloc(void)
 {
-    AVPacket *pkt = av_mallocz(sizeof(AVPacket));
+    AVPacket *pkt = av_malloc(sizeof(AVPacket));
     if (!pkt)
         return pkt;
 



More information about the ffmpeg-cvslog mailing list