---
 libavcodec/h264.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 16251d3..72dc429 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4186,7 +4186,8 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
             int dst_length;
             int bit_length;
             const uint8_t *ptr;
-            int i, nalsize = 0;
+            int i;
+            unsigned nalsize = 0;
             int err;
 
             if (buf_index >= next_avc) {
@@ -4195,9 +4196,9 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
                 nalsize = 0;
                 for (i = 0; i < h->nal_length_size; i++)
                     nalsize = (nalsize << 8) | buf[buf_index++];
-                if (nalsize <= 0 || nalsize > buf_size - buf_index) {
+                if (nalsize == 0 || nalsize > buf_size - buf_index) {
                     av_log(h->s.avctx, AV_LOG_ERROR,
-                           "AVC: nal size %d\n", nalsize);
+                           "AVC: nal size %u\n", nalsize);
                     break;
                 }
                 next_avc = buf_index + nalsize;
-- 
1.7.7.3

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to