diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 14:16:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 14:16:21 +0100 |
commit | a646ac8ef5c51d6a47eb564d58d04564c0489871 (patch) | |
tree | 7a9365c0d598a40815932f254a16d38eb3a13646 /libavcodec | |
parent | 53c2f401f726732e56343377452e487c8c6a0ee1 (diff) | |
parent | 90cfc084e3e6d37ab88fc96a95f0401d8e8b4cd1 (diff) | |
download | ffmpeg-a646ac8ef5c51d6a47eb564d58d04564c0489871.tar.gz |
Merge commit '90cfc084e3e6d37ab88fc96a95f0401d8e8b4cd1'
* commit '90cfc084e3e6d37ab88fc96a95f0401d8e8b4cd1':
avpacket: free side data in av_free_packet().
v4l2: do not assert on a value received from outside of Libav
v4l2: set the average framerate instead of codec timebase.
Conflicts:
libavcodec/avpacket.c
libavdevice/v4l2.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avpacket.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 516f1c972b..dea72e5d73 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -41,8 +41,6 @@ void av_destruct_packet(AVPacket *pkt) av_free(pkt->data); pkt->data = NULL; pkt->size = 0; - - ff_packet_free_side_data(pkt); } void av_init_packet(AVPacket *pkt) @@ -174,11 +172,16 @@ int av_copy_packet(AVPacket *dst, AVPacket *src) void av_free_packet(AVPacket *pkt) { if (pkt) { + int i; + if (pkt->destruct) pkt->destruct(pkt); pkt->data = NULL; pkt->size = 0; - pkt->side_data = NULL; + + for (i = 0; i < pkt->side_data_elems; i++) + av_free(pkt->side_data[i].data); + av_freep(&pkt->side_data); pkt->side_data_elems = 0; } } |