[libav-devel] [PATCH] nutdec: only copy the header if it exists

Luca Barbato lu_zero at gentoo.org
Fri Dec 18 18:53:03 CET 2015


On 18/12/15 17:24, Andreas Cadhalpun wrote:
> Fixes runtime error: null pointer passed as argument 2, which is
> declared to never be null
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/nutdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
> index 47ae7a7..3aa7a88 100644
> --- a/libavformat/nutdec.c
> +++ b/libavformat/nutdec.c
> @@ -1133,7 +1133,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
>      ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
>      if (ret < 0)
>          return ret;
> -    memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
> +    if (nut->header[header_idx])
> +        memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
>      pkt->pos = avio_tell(bc); // FIXME
>      if (stc->last_flags & FLAG_SM_DATA) {
>          int sm_size;
> 

When it happens exactly?

lu


More information about the libav-devel mailing list