avformat/apngenc: use av_packet_alloc()
authorJames Almer <jamrial@gmail.com>
Sat, 23 Sep 2017 05:15:16 +0000 (02:15 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 23 Sep 2017 05:18:36 +0000 (02:18 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/apngenc.c

index 378a9b3..d4191c0 100644 (file)
@@ -228,7 +228,7 @@ static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
     int ret;
 
     if (!apng->prev_packet) {
-        apng->prev_packet = av_malloc(sizeof(*apng->prev_packet));
+        apng->prev_packet = av_packet_alloc();
         if (!apng->prev_packet)
             return AVERROR(ENOMEM);