[FFmpeg-cvslog] avcodec: Fix reference data type for nvdec vc1 hwaccel

Philip Langdale git at videolan.org
Sat Nov 18 18:19:03 EET 2017


ffmpeg | branch: master | Philip Langdale <philipl at overt.org> | Thu Nov 16 07:31:58 2017 -0800| [5a0f6b099f3e8fcb95a80e3ffe52b3bf369efe24] | committer: Philip Langdale

avcodec: Fix reference data type for nvdec vc1 hwaccel

I took the reference lookup code from the vp9 hwaccel where the
type is unsigned char, but for vc1, the type is signed int.

This is particularly important because the value used when there's
no reference is different (255 vs -1).

It didn't seem to break anything, but for mpeg1/2/4, this mistake
caused decode errors.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a0f6b099f3e8fcb95a80e3ffe52b3bf369efe24
---

 libavcodec/nvdec_vc1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/nvdec_vc1.c b/libavcodec/nvdec_vc1.c
index cf75ba5aca..588a5b9d07 100644
--- a/libavcodec/nvdec_vc1.c
+++ b/libavcodec/nvdec_vc1.c
@@ -25,13 +25,13 @@
 #include "decode.h"
 #include "vc1.h"
 
-static unsigned char get_ref_idx(AVFrame *frame)
+static int get_ref_idx(AVFrame *frame)
 {
     FrameDecodeData *fdd;
     NVDECFrame *cf;
 
     if (!frame || !frame->private_ref)
-        return 255;
+        return -1;
 
     fdd = (FrameDecodeData*)frame->private_ref->data;
     cf  = (NVDECFrame*)fdd->hwaccel_priv;



More information about the ffmpeg-cvslog mailing list