diff options
author | Kieran Kunhya <kierank@obe.tv> | 2017-11-04 20:41:06 +0300 |
---|---|---|
committer | Your Name <you@example.com> | 2017-11-04 21:06:45 +0300 |
commit | 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b (patch) | |
tree | 56c68bb93e11ea3eed0869998566ad7f872861df /libavcodec/h2645_parse.h | |
parent | 3357b68bc02d855a92656d7a474b22adb32ca1a7 (diff) |
h2645_parse: Allocate a single buffer per packet
Drastically reduces memory usage on pathological streams.
Fixes ticket #6789
Diffstat (limited to 'libavcodec/h2645_parse.h')
-rw-r--r-- | libavcodec/h2645_parse.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h index 5f3e17a0f2..2e29ad26cb 100644 --- a/libavcodec/h2645_parse.h +++ b/libavcodec/h2645_parse.h @@ -30,7 +30,6 @@ typedef struct H2645NAL { uint8_t *rbsp_buffer; - int rbsp_buffer_size; int size; const uint8_t *data; @@ -65,9 +64,16 @@ typedef struct H2645NAL { int ref_idc; } H2645NAL; +typedef struct H2645RBSP { + uint8_t *rbsp_buffer; + int rbsp_buffer_alloc_size; + int rbsp_buffer_size; +} H2645RBSP; + /* an input packet split into unescaped NAL units */ typedef struct H2645Packet { H2645NAL *nals; + H2645RBSP rbsp; int nb_nals; int nals_allocated; } H2645Packet; @@ -75,7 +81,7 @@ typedef struct H2645Packet { /** * Extract the raw (unescaped) bitstream. */ -int ff_h2645_extract_rbsp(const uint8_t *src, int length, +int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp, H2645NAL *nal, int small_padding); /** |