avcodec/vdpau: fix assertion failure and < vs > error
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 28 Dec 2014 00:47:05 +0000 (01:47 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 28 Dec 2014 00:47:05 +0000 (01:47 +0100)
Fixes Ticket4211

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vdpau.c

index 6f9afa9..475a56c 100644 (file)
@@ -288,9 +288,8 @@ int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
 
 #if FF_API_BUFS_VDPAU
 FF_DISABLE_DEPRECATION_WARNINGS
-    av_assert0(sizeof(hwctx->info) >= sizeof(pic_ctx->info));
-    memset(&hwctx->info, 0, sizeof(hwctx->info));
-    memcpy(&hwctx->info, &pic_ctx->info, sizeof(pic_ctx->info));
+    av_assert0(sizeof(hwctx->info) <= sizeof(pic_ctx->info));
+    memcpy(&hwctx->info, &pic_ctx->info, sizeof(hwctx->info));
     hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
     hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
     hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;