ons 2019-09-18 klockan 02:03 +0200 skrev Andreas Rheinhardt:
> The pointer arguments to memcpy (and several other functions of the
> C standard library) are not allowed to be NULL, not even when the number
> of bytes to copy is zero. An AVEncryptionInitInfo's data pointer is
> explicitly allowed to be NULL and yet av_encryption_init_info_add_side_data
> unconditionally used it as a source pointer to copy from. This commit changes
> this so that copying is only done if the number of bytes to copy is > 0.

*gesticulates wildly with a formal verification stick*

> -        memcpy(cur_buffer, cur_info->data, cur_info->data_size);
> -        cur_buffer += cur_info->data_size;
> +        if (cur_info->data_size > 0) {
> +            memcpy(cur_buffer, cur_info->data, cur_info->data_size);
> +            cur_buffer += cur_info->data_size;
> +        }

Approve

There's no doubt more of these

/Tomas

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to