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

index 91cd40d..d6113db 100644 (file)
@@ -186,7 +186,7 @@ static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
     AVStream *video_st = s->streams[0];
 
     if (!gif->prev_pkt) {
     AVStream *video_st = s->streams[0];
 
     if (!gif->prev_pkt) {
-        gif->prev_pkt = av_malloc(sizeof(*gif->prev_pkt));
+        gif->prev_pkt = av_packet_alloc();
         if (!gif->prev_pkt)
             return AVERROR(ENOMEM);
 
         if (!gif->prev_pkt)
             return AVERROR(ENOMEM);