[FFmpeg-devel] [PATCH 3/3] avcodec/cbs_vp9: discard empty fragments

Mark Thompson sw at jkqxz.net
Wed Oct 31 01:19:34 EET 2018


On 30/10/18 19:21, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/cbs_vp9.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c
> index 7498be4b73..812be4ddd5 100644
> --- a/libavcodec/cbs_vp9.c
> +++ b/libavcodec/cbs_vp9.c
> @@ -403,6 +403,9 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx,
>      uint8_t superframe_header;
>      int err;
>  
> +    if (frag->data_size <= 0)
> +        return 0;
> +
>      // Last byte in the packet.
>      superframe_header = frag->data[frag->data_size - 1];
>  
> 

Seems fine, but why would an empty fragment appear here?

(Given that H.26[45] has pretty much the same check, maybe it should be in the generic code.)

Thanks,

- Mark


More information about the ffmpeg-devel mailing list