745a78a9c2501 Mon Sep 17 00:00:00 2001
From: Andriy Lysnevych
Date: Wed, 25 May 2016 17:56:21 +0300
Subject: [PATCH] Respect payload offset in av_grow_packet
---
libavcodec/avpacket.c | 28 +---
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/libavcodec/a
You are right. Please review updated patch.
From 62b31fa4b05fc600eada4fb28b352e5b87bd60f8 Mon Sep 17 00:00:00 2001
From: Andriy Lysnevych
Date: Wed, 25 May 2016 12:55:39 +0300
Subject: [PATCH] Respect payload offset in av_grow_packet
---
libavcodec/avpacket.c | 19 ---
1 file
This one removed:
>> -if (!pkt->size)
>> -return av_new_packet(pkt, grow_by);
pkt->size can be 0 but reference-counted buf allocated. av_new_packet
leads to memory leak in this case. (FIXME?)
>> -if ((unsigned)grow_by >
>> -INT_MAX - (pkt->size + AV_INPUT_BUFFER_PADDING_S
Sorry, looks like problems with my mail client. Sending patch as attachment.
From 45f69d7f02928ad8abae3fc591082997590c597a Mon Sep 17 00:00:00 2001
From: Andriy Lysnevych
Date: Mon, 16 May 2016 12:08:33 +0300
Subject: [PATCH] Respect payload offset in av_grow_packet
---
libavcodec/avpacket.c
Patch for latest master
---
libavcodec/avpacket.c | 25 +++--
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index bcc7c79..327cd41 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -110,24 +110,29
> Anyway, example how this change can break:
>
> typedef struct AVPacket AVPacket;
>
> AVPacket *av_packet_clone_old(AVPacket *src);
> AVPacket *av_packet_clone_new(const AVPacket *src);
>
> AVPacket *(*unsuspecting_api_user)(AVPacket *src);
>
> void set(void)
> {
> unsuspecting_api_user = av_p
The patch fixes the function when used with reference-counted packets
that have payload offset.
Also this function is dangerous for not reference-counted packets
because it just overwrites pkt->data. Probably it is better to
restrict using it with not referenced-counted packets because you
simply
> That's a change that could break source-compatibility with C++, I don't
think it can be made so easily.
I do not agree. It extends function so it can take as argument both const
and non-const packets.
Actually I discovered this defect when I was not able to clone const packet
in C++ project.
__
You are right
---
libavcodec/avpacket.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dd8b71e..19597f2 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -568,16 +568,18 @@ int av_packet_ref(AVPacket *dst,
Details are in the ticket https://trac.ffmpeg.org/ticket/5543
---
libavcodec/avpacket.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dd8b71e..842d8ba 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -56
---
libavcodec/avcodec.h | 2 +-
libavcodec/avpacket.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 97b2128..1ad0412 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4300,7 +4300,7 @@ AVPacket *av_packet_a
11 matches
Mail list logo