diff mbox series

[FFmpeg-devel,205/217] avcodec/dvbsubdec: Add const where appropriate

Message ID 20201202042244.519127-71-andreas.rheinhardt@gmail.com
State Accepted
Commit 834ef6f4a9af80f8a9b0029c03a9b9e12bb36acc
Headers show
Series [FFmpeg-devel,01/45] avcodec/a64multienc: Fix memleak upon init failure | expand


Context Check Description
andriy/x86 warning Failed to apply patch

Commit Message

Andreas Rheinhardt Dec. 2, 2020, 4:22 a.m. UTC
These pointers sometimes point to static storage (namely to
default_clut), so adding const to the pointed-to type is important to
ensure that one does not accidentally modify something that is not owned
by a single AVCodecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
 libavcodec/dvbsubdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series


diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 9bee33e4a2..b1a0c3ff24 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -724,8 +724,8 @@  static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
     DVBSubDisplayDefinition *display_def = ctx->display_definition;
     DVBSubRegion *region;
     AVSubtitleRect *rect;
-    DVBSubCLUT *clut;
-    uint32_t *clut_table;
+    const DVBSubCLUT *clut;
+    const uint32_t *clut_table;
     int i;
     int offset_x=0, offset_y=0;
     int ret = 0;
@@ -1454,8 +1454,8 @@  static int save_display_set(DVBSubContext *ctx)
     DVBSubRegion *region;
     DVBSubRegionDisplay *display;
-    DVBSubCLUT *clut;
-    uint32_t *clut_table;
+    const DVBSubCLUT *clut;
+    const uint32_t *clut_table;
     int x_pos, y_pos, width, height;
     int x, y, y_off, x_off;
     uint32_t *pbuf;