[FFmpeg-devel] [PATCH 07/17] avformat/mxfenc: Error out when receiving invalid data

Tomas Härdin tjoppen at acc.umu.se
Tue Nov 9 23:22:12 EET 2021


tis 2021-11-09 klockan 19:01 +0100 skrev Andreas Rheinhardt:
> (Unless the packet has a size of zero, the packet will run afoul
> of the cbr_index check a few lines below.)
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavformat/mxfenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index a6535eb43f..c20ba9bfca 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -2151,7 +2151,7 @@ static int mxf_parse_dv_frame(AVFormatContext
> *s, AVStream *st, AVPacket *pkt)
>  
>      // Check for minimal frame size
>      if (pkt->size < 120000)
> -        return -1;
> +        return 0;

Might be nicer to have negative return value mean error, just like
everywhere else, and change the code further down accordingly. -1 is a
crappy return value for mxf_write_packet() I think. But then the other
parsing functions should change at the same time. So let's not hold
this patch up with that. Looks OK for now.

/Tomas



More information about the ffmpeg-devel mailing list