[FFmpeg-cvslog] avcodec/magicyuv: remove redundant check in inner loop

Michael Niedermayer git at videolan.org
Fri Oct 27 19:19:38 EEST 2023


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Oct 22 17:09:30 2023 +0200| [a23d527ec5d550664fd595d22e6241c7b709fc96] | committer: Michael Niedermayer

avcodec/magicyuv: remove redundant check in inner loop

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a23d527ec5d550664fd595d22e6241c7b709fc96
---

 libavcodec/magicyuv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index d813f20920..3f6348b531 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -125,10 +125,9 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1,
     for (; CACHED_BITSTREAM_READER && x < width-c && get_bits_left(&gb) > 0;) {\
         ret = get_vlc_multi(&gb, (uint8_t *)dst + x * b, multi, \
                             vlc, vlc_bits, 3); \
-        if (ret > 0) \
-            x += ret; \
         if (ret <= 0) \
             return AVERROR_INVALIDDATA; \
+        x += ret; \
     } \
     for (; x < width && get_bits_left(&gb) > 0; x++) \
         dst[x] = get_vlc2(&gb, vlc, vlc_bits, 3); \



More information about the ffmpeg-cvslog mailing list