Files
ffmpeg/libavcodec
Andreas Rheinhardt 07eb039e04 avcodec/hevc_mp4toannexb_bsf: Check NAL size against available input
The hevc_mp4toannexb bsf does not explicitly check whether a NAL unit
is so big that it extends beyond the end of the input packet; it does so
only implicitly by using the checked version of the bytestream2 API.
But this has downsides compared to real checks: It can lead to huge
allocations (up to 2GiB) even when the input packet is just a few bytes.
And furthermore it leads to uninitialized data being output.
So add a check to error out early if it happens.

Also check directly whether there is enough data for the length field.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit ea1b71e82f)
2020-06-15 04:46:05 +02:00
..
2020-05-20 03:16:34 +02:00
2019-06-12 20:06:20 +10:00
2019-06-26 21:25:10 +02:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2019-06-12 20:06:20 +10:00
2019-09-04 20:26:35 +02:00
2020-05-21 15:32:28 +02:00
2020-05-19 17:17:36 +02:00
2019-04-21 19:43:14 +02:00
2019-05-06 23:58:34 +02:00
2019-12-31 19:51:57 +01:00
2019-06-29 19:22:19 +02:00
2019-07-01 13:24:57 +08:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:36 +02:00
2019-09-02 13:53:08 -07:00
2019-03-31 23:35:00 +02:00
2020-05-20 03:24:57 +02:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:35 +02:00
2019-05-07 11:00:19 +08:00
2019-04-03 23:00:15 +08:00
2020-05-19 17:17:35 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:57 +01:00
2019-07-08 09:38:03 +02:00
2020-05-20 03:11:21 +02:00
2020-05-20 03:08:52 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-06-12 20:06:20 +10:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-09-04 20:26:35 +02:00
2019-08-05 19:34:33 +02:00
2019-05-02 15:36:16 +02:00