hwcontext_vdpau: Fix missing subscripts
authorMark Thompson <sw@jkqxz.net>
Tue, 13 Sep 2016 19:45:55 +0000 (20:45 +0100)
committerMark Thompson <sw@jkqxz.net>
Wed, 14 Sep 2016 19:48:36 +0000 (20:48 +0100)
Also remove the redundant casts which were hiding the error here.

libavutil/hwcontext_vdpau.c

index 4860aaa..b12109c 100644 (file)
@@ -304,7 +304,7 @@ static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
 
     for (i = 0; i< FF_ARRAY_ELEMS(data) && dst->data[i]; i++) {
         data[i] = dst->data[i];
-        if (dst->linesize[i] < 0 || (uint64_t)dst->linesize > UINT32_MAX) {
+        if (dst->linesize[i] < 0 || dst->linesize[i] > UINT32_MAX) {
             av_log(ctx, AV_LOG_ERROR,
                    "The linesize %d cannot be represented as uint32\n",
                    dst->linesize[i]);
@@ -355,7 +355,7 @@ static int vdpau_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
 
     for (i = 0; i< FF_ARRAY_ELEMS(data) && src->data[i]; i++) {
         data[i] = src->data[i];
-        if (src->linesize[i] < 0 || (uint64_t)src->linesize > UINT32_MAX) {
+        if (src->linesize[i] < 0 || src->linesize[i] > UINT32_MAX) {
             av_log(ctx, AV_LOG_ERROR,
                    "The linesize %d cannot be represented as uint32\n",
                    src->linesize[i]);