[FFmpeg-devel] avcodec/packet: initialize payload size to zero

Submitted by Andriy Gelman on April 3, 2019, 3:57 a.m.

Details

Message ID 20190403035710.13067-1-andriy.gelman@gmail.com
State New
Headers show

Commit Message

Andriy Gelman April 3, 2019, 3:57 a.m.
From: Andriy Gelman <andriy.gelman@gmail.com>

---
 libavcodec/avpacket.c | 1 +
 1 file changed, 1 insertion(+)

Comments

mypopy@gmail.com April 3, 2019, 6:09 a.m.
On Wed, Apr 3, 2019 at 11:57 AM Andriy Gelman <andriy.gelman@gmail.com> wrote:
>
> From: Andriy Gelman <andriy.gelman@gmail.com>
>
> ---
>  libavcodec/avpacket.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index 8f0603df78..6ae092ed31 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -44,6 +44,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      pkt->flags                = 0;
>      pkt->stream_index         = 0;
>      pkt->buf                  = NULL;
> +    pkt->size                 = 0;
>      pkt->side_data            = NULL;
>      pkt->side_data_elems      = 0;
>  }

I think you can refer to the link about this question:
https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg64312.html

In this list, As Hendrik Leppkes likes to point out, " Code can
currently rely on size/data to not be modified - and I'm sure there
are also places where it does."

So I think we can't change as this patch if can't find a way to fight
the API break. Thanks.
Ben Hutchinson April 3, 2019, 7:12 a.m.
How do I unsubscribe from ffmpeg-devel?

On Tue, Apr 2, 2019 at 8:57 PM Andriy Gelman <andriy.gelman@gmail.com>
wrote:

> From: Andriy Gelman <andriy.gelman@gmail.com>
>
> ---
>  libavcodec/avpacket.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index 8f0603df78..6ae092ed31 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -44,6 +44,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      pkt->flags                = 0;
>      pkt->stream_index         = 0;
>      pkt->buf                  = NULL;
> +    pkt->size                 = 0;
>      pkt->side_data            = NULL;
>      pkt->side_data_elems      = 0;
>  }
> --
> 2.21.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Patch hide | download patch | download mbox

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8f0603df78..6ae092ed31 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -44,6 +44,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     pkt->flags                = 0;
     pkt->stream_index         = 0;
     pkt->buf                  = NULL;
+    pkt->size                 = 0;
     pkt->side_data            = NULL;
     pkt->side_data_elems      = 0;
 }