diff mbox series

[FFmpeg-devel,2/8] avformat/mux: fix check_packet with null packet

Message ID 20200328181515.5333-2-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,1/8] fftools/ffmpeg: also flush encoders which have a variable frame size
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint March 28, 2020, 6:15 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Rheinhardt March 28, 2020, 8:11 p.m. UTC | #1
Marton Balint:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/mux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index bfd1bf491b..dfb21c8aa5 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -798,7 +798,7 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>  
>  #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
>      /* sanitize the timestamps */
> -    if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
> +    if (pkt && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
>          AVStream *st = s->streams[pkt->stream_index];
>  
>          /* when there is no reordering (so dts is equal to pts), but
> 
Overlaps with [1].

- Andreas

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248144.html
Marton Balint March 28, 2020, 10:42 p.m. UTC | #2
On Sat, 28 Mar 2020, Andreas Rheinhardt wrote:

> Marton Balint:
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/mux.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavformat/mux.c b/libavformat/mux.c
>> index bfd1bf491b..dfb21c8aa5 100644
>> --- a/libavformat/mux.c
>> +++ b/libavformat/mux.c
>> @@ -798,7 +798,7 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>>
>>  #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
>>      /* sanitize the timestamps */
>> -    if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
>> +    if (pkt && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
>>          AVStream *st = s->streams[pkt->stream_index];
>>
>>          /* when there is no reordering (so dts is equal to pts), but
>> 
> Overlaps with [1].

Can you resend still valid patches from that series? I might have more 
knowledge now to review...

Thanks,
Marton
diff mbox series

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index bfd1bf491b..dfb21c8aa5 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -798,7 +798,7 @@  static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
 
 #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
     /* sanitize the timestamps */
-    if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
+    if (pkt && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
         AVStream *st = s->streams[pkt->stream_index];
 
         /* when there is no reordering (so dts is equal to pts), but