[1/4] h264_slice: Drop pointless assert

Message ID 1479885295-23515-1-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Nov. 23, 2016, 7:14 a.m.
---
 libavcodec/h264_slice.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Kieran Kunhya Nov. 23, 2016, 8:37 p.m. | #1
On Wed, 23 Nov 2016 at 07:15 Diego Biurrun <diego@biurrun.de> wrote:

> ---
>  libavcodec/h264_slice.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
>
Why is this pointless?
Kieran

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 8d79740..87d6582 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -286,8 +286,6 @@  static int initialize_cur_frame(H264Context *h)
     return 0;
 }
 
-#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
-
 #define REBASE_PICTURE(pic, new_ctx, old_ctx)             \
     ((pic && pic >= old_ctx->DPB &&                       \
       pic < old_ctx->DPB + H264_MAX_PICTURE_COUNT) ?          \
@@ -298,14 +296,8 @@  static void copy_picture_range(H264Picture **to, H264Picture **from, int count,
                                H264Context *old_base)
 {
     int i;
-
-    for (i = 0; i < count; i++) {
-        assert((IN_RANGE(from[i], old_base, sizeof(*old_base)) ||
-                IN_RANGE(from[i], old_base->DPB,
-                         sizeof(H264Picture) * H264_MAX_PICTURE_COUNT) ||
-                !from[i]));
+    for (i = 0; i < count; i++)
         to[i] = REBASE_PICTURE(from[i], new_base, old_base);
-    }
 }
 
 static int h264_slice_header_init(H264Context *h);