summaryrefslogtreecommitdiffstats
path: root/doc/examples/encode_video.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2024-03-25 14:54:35 +0100
committerAndreas Rheinhardt <[email protected]>2024-03-28 03:08:01 +0100
commitc85477f78d7916b663bd09169c7ce8d4d345bca3 (patch)
tree36323588d9dcde460a174d8710b342a88df3836e /doc/examples/encode_video.c
parentaa7d6520e6335f9ed45ca2bf0fbf932fb4b2dea6 (diff)
avutil/opt: Don't cast when the result might be misaligned
A pointer conversion is UB if the resulting pointer is not correctly aligned for the resultant type, even if no load/store is ever performed through that pointer (C11 6.3.2.3 (7)). This may happen in opt_copy_elem(), because the pointers are converted even when they belong to a type that does not guarantee sufficient alignment. Fix this by deferring the cast after having checked the type. Also make the casts -Wcast-qual safe and avoid an indirection for src. Signed-off-by: Andreas Rheinhardt <[email protected]>
Diffstat (limited to 'doc/examples/encode_video.c')
0 files changed, 0 insertions, 0 deletions