diff mbox series

[FFmpeg-devel,1/5] avcodec/nvdec_(mjpeg|vp8): Constify AVHWAccels

Message ID GV1P250MB07372D6E72B1402AB543507C8F0BA@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,1/5] avcodec/nvdec_(mjpeg|vp8): Constify AVHWAccels | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 2, 2023, 6:38 a.m. UTC
The discrepancy between the actual definition and the declarations
in hwaccels.h is actually UB.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Resending patches 1-3 because the last patch depends upon it.

 libavcodec/nvdec_mjpeg.c | 2 +-
 libavcodec/nvdec_vp8.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Timo Rothenpieler Aug. 2, 2023, 12:18 p.m. UTC | #1
lgtm
diff mbox series

Patch

diff --git a/libavcodec/nvdec_mjpeg.c b/libavcodec/nvdec_mjpeg.c
index fce464c1f8..daaf0072ed 100644
--- a/libavcodec/nvdec_mjpeg.c
+++ b/libavcodec/nvdec_mjpeg.c
@@ -69,7 +69,7 @@  static int nvdec_mjpeg_frame_params(AVCodecContext *avctx,
     return ff_nvdec_frame_params(avctx, hw_frames_ctx, 1, 0);
 }
 
-AVHWAccel ff_mjpeg_nvdec_hwaccel = {
+const AVHWAccel ff_mjpeg_nvdec_hwaccel = {
     .name                 = "mjpeg_nvdec",
     .type                 = AVMEDIA_TYPE_VIDEO,
     .id                   = AV_CODEC_ID_MJPEG,
diff --git a/libavcodec/nvdec_vp8.c b/libavcodec/nvdec_vp8.c
index f174ca430f..3812ef3e1a 100644
--- a/libavcodec/nvdec_vp8.c
+++ b/libavcodec/nvdec_vp8.c
@@ -90,7 +90,7 @@  static int nvdec_vp8_frame_params(AVCodecContext *avctx,
     return ff_nvdec_frame_params(avctx, hw_frames_ctx, 3, 0);
 }
 
-AVHWAccel ff_vp8_nvdec_hwaccel = {
+const AVHWAccel ff_vp8_nvdec_hwaccel = {
     .name                 = "vp8_nvdec",
     .type                 = AVMEDIA_TYPE_VIDEO,
     .id                   = AV_CODEC_ID_VP8,