[FFmpeg-devel] [PATCH 2/4] svq1dec: check return value of get_bits1() in more common way

Paul B Mahol onemda at gmail.com
Sun Oct 14 11:23:59 CEST 2012


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/svq1dec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index b5999d4..8e4a482 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -100,7 +100,7 @@ static const uint8_t string_table[256] = {
                 break;                                                  \
         }                                                               \
         /* divide block if next bit set */                              \
-        if (get_bits1(bitbuf) == 0)                                     \
+        if (!get_bits1(bitbuf))                                         \
             break;                                                      \
         /* add child nodes */                                           \
         list[n++] = list[i];                                            \
@@ -564,7 +564,7 @@ static int svq1_decode_frame_header(GetBitContext *bitbuf, MpegEncContext *s)
     }
 
     /* unknown fields */
-    if (get_bits1(bitbuf) == 1) {
+    if (get_bits1(bitbuf)) {
         skip_bits1(bitbuf);    /* use packet checksum if (1) */
         skip_bits1(bitbuf);    /* component checksums after image data if (1) */
 
@@ -572,13 +572,13 @@ static int svq1_decode_frame_header(GetBitContext *bitbuf, MpegEncContext *s)
             return AVERROR_INVALIDDATA;
     }
 
-    if (get_bits1(bitbuf) == 1) {
+    if (get_bits1(bitbuf)) {
         skip_bits1(bitbuf);
         skip_bits(bitbuf, 4);
         skip_bits1(bitbuf);
         skip_bits(bitbuf, 2);
 
-        while (get_bits1(bitbuf) == 1)
+        while (get_bits1(bitbuf))
             skip_bits(bitbuf, 8);
     }
 
-- 
1.7.11.4



More information about the ffmpeg-devel mailing list