mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-30 04:02:04 +08:00 
			
		
		
		
	avcodec/diracdsp: Fix integer overflow in PUT_SIGNED_RECT_CLAMPED()
Fixes: runtime error: signed integer overflow: 2147483646 + 2048 cannot be represented in type 'int' Fixes: 4479/clusterfuzz-testcase-minimized-6529894147162112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		| @@ -159,10 +159,10 @@ static void put_signed_rect_clamped_ ## PX ## bit_c(uint8_t *_dst, int dst_strid | ||||
|     int32_t *src = (int32_t *)_src;                                                                     \ | ||||
|     for (y = 0; y < height; y++) {                                                                      \ | ||||
|         for (x = 0; x < width; x+=4) {                                                                  \ | ||||
|             dst[x  ] = av_clip_uintp2(src[x  ] + (1 << (PX - 1)), PX);                                  \ | ||||
|             dst[x+1] = av_clip_uintp2(src[x+1] + (1 << (PX - 1)), PX);                                  \ | ||||
|             dst[x+2] = av_clip_uintp2(src[x+2] + (1 << (PX - 1)), PX);                                  \ | ||||
|             dst[x+3] = av_clip_uintp2(src[x+3] + (1 << (PX - 1)), PX);                                  \ | ||||
|             dst[x  ] = av_clip_uintp2(src[x  ] + (1U << (PX - 1)), PX);                                  \ | ||||
|             dst[x+1] = av_clip_uintp2(src[x+1] + (1U << (PX - 1)), PX);                                  \ | ||||
|             dst[x+2] = av_clip_uintp2(src[x+2] + (1U << (PX - 1)), PX);                                  \ | ||||
|             dst[x+3] = av_clip_uintp2(src[x+3] + (1U << (PX - 1)), PX);                                  \ | ||||
|         }                                                                                               \ | ||||
|         dst += dst_stride >> 1;                                                                         \ | ||||
|         src += src_stride >> 2;                                                                         \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Niedermayer
					Michael Niedermayer