On 10.01.2022 13:49, Roman Arzumanyan wrote:
Hello,

This patch memsets NV_ENC_REGISTER_RESOURCE structure with zeros.
Without that, in rare occasions NV_ENC_REGISTER_RESOURCE::bufferUsage structure field may accidentaly take NV_ENC_OUTPUT_MOTION_VECTOR value causing nvEncRegisterResource() function to fail.

The rest of nvenc.c uses "= { 0 };" to zero-initialize structs.
For some reason this wasn't done here.
This would be the only instance of using memset() in the whole file.

Do you have a way to check if just doing

NV_ENC_REGISTER_RESOURCE reg = { 0 };

Also solves the issue?

I just pushed that change, since it's clearly an oversight.
If it's still causing issues, let me know and memset is definitely an option.
But any standard-abiding C-Compiler should zero initialize the struct now.



Thanks,
Timo


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
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