Browse Source

swscale: avoid invalid pointer conversion

(cherry picked from commit ab00e6c59d)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
cherry-pick-c5513cf9
Rémi Denis-Courmont 8 years ago
committed by Thomas Guillem
parent
commit
45198e5328
  1. 12
      modules/video_chroma/swscale.c

12
modules/video_chroma/swscale.c

@ -588,8 +588,9 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
{
filter_sys_t *p_sys = p_filter->p_sys;
uint8_t palette[AVPALETTE_SIZE];
uint8_t *src[4]; int src_stride[4];
uint8_t *dst[4]; int dst_stride[4];
uint8_t *src[4], *dst[4];
const uint8_t *csrc[4];
int src_stride[4], dst_stride[4];
GetPixels( src, src_stride, p_sys->desc_in, &p_filter->fmt_in.video,
p_src, i_plane_count, b_swap_uvi );
@ -606,11 +607,14 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
GetPixels( dst, dst_stride, p_sys->desc_out, &p_filter->fmt_out.video,
p_dst, i_plane_count, b_swap_uvo );
for (size_t i = 0; i < ARRAY_SIZE(src); i++)
csrc[i] = src[i];
#if LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)
sws_scale( ctx, src, src_stride, 0, i_height,
sws_scale( ctx, csrc, src_stride, 0, i_height,
dst, dst_stride );
#else
sws_scale_ordered( ctx, src, src_stride, 0, i_height,
sws_scale_ordered( ctx, csrc, src_stride, 0, i_height,
dst, dst_stride );
#endif
}

Loading…
Cancel
Save