diff mbox series

[FFmpeg-devel,v2,20/22] avcodec/v210dec: Don't cast const away

Message ID AS8P250MB0744011E1DC69C302F1F70A58FEEA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 2f9a33995a7be728d7ab4dce913be5a871c5cc5f
Headers show
Series [FFmpeg-devel,v2,01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue | expand

Commit Message

Andreas Rheinhardt Sept. 7, 2023, 1:05 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/v210dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paul B Mahol Sept. 7, 2023, 7:36 a.m. UTC | #1
LGTM
diff mbox series

Patch

diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 814d65bbda..04bcc612b7 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -33,7 +33,7 @@ 
 
 typedef struct ThreadData {
     AVFrame *frame;
-    uint8_t *buf;
+    const uint8_t *buf;
     int stride;
 } ThreadData;
 
@@ -111,7 +111,7 @@  static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th
     int stride = td->stride;
     int slice_start = (avctx->height *  jobnr) / s->thread_count;
     int slice_end = (avctx->height * (jobnr+1)) / s->thread_count;
-    uint8_t *psrc = td->buf + stride * slice_start;
+    const uint8_t *psrc = td->buf + stride * slice_start;
     int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2;
     int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2;
     int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2;
@@ -191,7 +191,7 @@  static int decode_frame(AVCodecContext *avctx, AVFrame *pic,
 
     if (stride) {
         td.stride = stride;
-        td.buf = (uint8_t*)psrc;
+        td.buf = psrc;
         td.frame = pic;
         avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count);
     } else {