Browse Source

cbs_h2645: Allocate all internal buffers with padding

Any of these buffers (for both H.264 and H.265) might reasonably be
parsed using the bitstream reader, so include padding on all of them.
tags/n4.1
Mark Thompson 6 years ago
parent
commit
da6db843b8
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      libavcodec/cbs_h2645.c
  2. +1
    -1
      libavcodec/cbs_h264_syntax_template.c

+ 2
- 1
libavcodec/cbs_h2645.c View File

@@ -319,7 +319,8 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
#define byte_alignment(rw) (get_bits_count(rw) % 8) #define byte_alignment(rw) (get_bits_count(rw) % 8)


#define allocate(name, size) do { \ #define allocate(name, size) do { \
name ## _ref = av_buffer_allocz(size); \
name ## _ref = av_buffer_allocz(size + \
AV_INPUT_BUFFER_PADDING_SIZE); \
if (!name ## _ref) \ if (!name ## _ref) \
return AVERROR(ENOMEM); \ return AVERROR(ENOMEM); \
name = name ## _ref->data; \ name = name ## _ref->data; \


+ 1
- 1
libavcodec/cbs_h264_syntax_template.c View File

@@ -718,7 +718,7 @@ static int FUNC(sei_user_data_registered)(CodedBitstreamContext *ctx, RWContext
*payload_size = i + current->data_length; *payload_size = i + current->data_length;
#endif #endif


allocate(current->data, current->data_length + AV_INPUT_BUFFER_PADDING_SIZE);
allocate(current->data, current->data_length);
for (j = 0; j < current->data_length; j++) for (j = 0; j < current->data_length; j++)
xu(8, itu_t_t35_payload_byte[i], current->data[j], 0x00, 0xff, 1, i + j); xu(8, itu_t_t35_payload_byte[i], current->data[j], 0x00, 0xff, 1, i + j);




Loading…
Cancel
Save