diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-01-26 20:16:53 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-01-28 12:29:24 +0100 |
commit | bbe1b21022e4872bc64066d46a4567dc1b655f7a (patch) | |
tree | d7fc11436de805c28a6176b9eac690e1abaacfa1 /libavcodec/nvenc.h | |
parent | a026a3efaeb9c2026668dccbbda339a21ab3206b (diff) |
avcodec/nvenc: refcount input frame mappings
If some logic like vsync in ffmpeg.c duplicates frames, it might pass
the same frame twice, which will result in a crash due it being
effectively mapped and unmapped twice.
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r-- | libavcodec/nvenc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index 2e51f1e946..ab6825f633 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -44,7 +44,6 @@ typedef struct NvencSurface { NV_ENC_INPUT_PTR input_surface; AVFrame *in_ref; - NV_ENC_MAP_INPUT_RESOURCE in_map; int reg_idx; int width; int height; @@ -131,6 +130,7 @@ typedef struct NvencContext int ptr_index; NV_ENC_REGISTERED_PTR regptr; int mapped; + NV_ENC_MAP_INPUT_RESOURCE in_map; } registered_frames[MAX_REGISTERED_FRAMES]; int nb_registered_frames; |