The 2nd condition being true implies the 1st condition being true.
This also fixes a gcc warning about using 'val' uninitialized.
---
libavcodec/v210enc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 714b6fb..af9f77d 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -93,7 +93,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char
*buf,
val = CLIP(*y++);
if (w == avctx->width - 2)
bytestream2_put_le32u(&p, val);
- }
+
if (w < avctx->width - 3) {
val |= (CLIP(*u++) << 10) | (CLIP(*y++) << 20);
bytestream2_put_le32u(&p, val);
@@ -101,6 +101,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned
char *buf,
val = CLIP(*v++) | (CLIP(*y++) << 10);
bytestream2_put_le32u(&p, val);
}
+ }
bytestream2_set_buffer(&p, 0, line_padding);
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel