avcodec/avpacket: remove unnecessary check in av_packet_make_writable()
authorJames Almer <jamrial@gmail.com>
Mon, 26 Mar 2018 00:23:54 +0000 (21:23 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 27 Mar 2018 14:25:57 +0000 (11:25 -0300)
Zero sized packets are already handled below in the function.
This is more in line with av_packet_ref().

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/avpacket.c

index 0693ca6..0993481 100644 (file)
@@ -660,9 +660,6 @@ int av_packet_make_writable(AVPacket *pkt)
     if (pkt->buf && av_buffer_is_writable(pkt->buf))
         return 0;
 
-    if (!pkt->data)
-        return AVERROR(EINVAL);
-
     ret = packet_alloc(&buf, pkt->size);
     if (ret < 0)
         return ret;