Skip to content

Commit b61d7dd

Browse files
committed
lavd: added/fixed aligntment assertions
1 parent 04cd6d4 commit b61d7dd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/libavcodec/from_lavc_vid_conv.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ static inline void gbrpXXle_to_rgba(char * __restrict dst_buffer, AVFrame * __re
552552
int width, int height, int pitch, const int * __restrict rgb_shift, unsigned int in_depth)
553553
{
554554
assert((uintptr_t) dst_buffer % 4 == 0);
555-
assert((uintptr_t) frame->linesize[0] % 2 == 0);
556-
assert((uintptr_t) frame->linesize[1] % 2 == 0);
557-
assert((uintptr_t) frame->linesize[2] % 2 == 0);
555+
assert((uintptr_t) frame->data[0] % 2 == 0);
556+
assert((uintptr_t) frame->data[1] % 2 == 0);
557+
assert((uintptr_t) frame->data[2] % 2 == 0);
558558

559559
uint32_t alpha_mask = 0xFFFFFFFFU ^ (0xFFU << rgb_shift[R]) ^ (0xFFU << rgb_shift[G]) ^ (0xFFU << rgb_shift[B]);
560560

@@ -1437,6 +1437,10 @@ static void yuv444p10le_to_uyvy(char * __restrict dst_buffer, AVFrame * __restri
14371437
static void yuv444p10le_to_y416(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
14381438
int width, int height, int pitch, const int * __restrict rgb_shift)
14391439
{
1440+
assert((uintptr_t) dst_buffer % 2 == 0);
1441+
assert((uintptr_t) in_frame->data[0] % 2 == 0);
1442+
assert((uintptr_t) in_frame->data[1] % 2 == 0);
1443+
assert((uintptr_t) in_frame->data[2] % 2 == 0);
14401444
UNUSED(rgb_shift);
14411445
for(int y = 0; y < (int) height; ++y) {
14421446
uint16_t *src_y = (uint16_t *)(void *)(in_frame->data[0] + in_frame->linesize[0] * y);

0 commit comments

Comments
 (0)