diff mbox series

[FFmpeg-devel,1/4] libavcodec/lcldec: width and height should not be unsigned

Message ID 20230309125717.29821-1-michael@niedermayer.cc
State Accepted
Commit 3eb4e28c26c3bce608214f392ab1fe6ee28ec1df
Headers show
Series [FFmpeg-devel,1/4] libavcodec/lcldec: width and height should not be unsigned | 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

Michael Niedermayer March 9, 2023, 12:57 p.m. UTC
Computations like col < width - 3 will not work with unsigned width=1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/lcldec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer April 16, 2023, 8:33 p.m. UTC | #1
On Thu, Mar 09, 2023 at 01:57:14PM +0100, Michael Niedermayer wrote:
> Computations like col < width - 3 will not work with unsigned width=1
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/lcldec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index 5cc0a29bcd..95206eeb69 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -169,8 +169,8 @@  static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
     int row, col;
     unsigned char *encoded = avpkt->data, *outptr;
     uint8_t *y_out, *u_out, *v_out;
-    unsigned int width = avctx->width; // Real image width
-    unsigned int height = avctx->height; // Real image height
+    int width = avctx->width; // Real image width
+    int height = avctx->height; // Real image height
     unsigned int mszh_dlen;
     unsigned char yq, y1q, uq, vq;
     int uqvq, ret;