Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2019-12-06 19:03:02 +0300
committerJames Almer <jamrial@gmail.com>2019-12-06 21:05:56 +0300
commit02a83e26de6a58523ee55cfebc1312e7a4e42724 (patch)
tree3745b51f3ebbbc2c7a1b7718a5de030660a06a21 /libavcodec/cbs_h2645.c
parent79d907774d59119dcfd1c04dae97b52890aec3ec (diff)
lavc/cbs_h2645: Fix incorrect max size of nalu unit
In the worst case the startcode prefix has 4 bytes. This fixes a trigerred assertion: Assertion dp <= max_size failed at libavcodec/cbs_h2645.c:1451 Found-by:libFuzzer Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Diffstat (limited to 'libavcodec/cbs_h2645.c')
-rw-r--r--libavcodec/cbs_h2645.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 88fa0029cd..5f71d80584 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -1395,7 +1395,7 @@ static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx,
max_size = 0;
for (i = 0; i < frag->nb_units; i++) {
// Start code + content with worst-case emulation prevention.
- max_size += 3 + frag->units[i].data_size * 3 / 2;
+ max_size += 4 + frag->units[i].data_size * 3 / 2;
}
data = av_realloc(NULL, max_size + AV_INPUT_BUFFER_PADDING_SIZE);