1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00
FFmpeg/libavcodec
Andreas Rheinhardt b66884f4aa 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 ea1b71e82f5a1752d59d3bfb9704092a79eba6b5)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-03 00:04:06 +02:00
..
2020-07-03 00:03:44 +02:00
2017-05-29 14:08:07 +02:00
2017-10-03 19:47:37 -03:00
2019-11-14 23:30:37 +01:00
2017-07-07 15:23:58 -04:00
2017-05-08 12:30:09 +02:00
2018-06-18 01:16:03 +02:00
2017-07-07 15:29:57 -04:00
2019-11-15 12:25:45 +01:00
2018-01-28 15:33:08 +01:00
2020-07-02 19:55:09 +02:00
2017-10-03 19:47:37 -03:00
2018-06-18 01:16:04 +02:00
2017-05-23 15:25:11 +02:00
2019-11-14 23:30:37 +01:00
2017-09-16 19:55:03 +02:00
2019-11-15 12:25:46 +01:00
2017-08-30 12:13:01 +02:00
2017-04-23 14:27:47 +07:00
2020-07-02 19:55:09 +02:00
2020-07-02 19:55:10 +02:00
2017-07-12 20:36:13 +02:00
2019-11-14 23:30:37 +01:00
2017-10-03 19:47:37 -03:00
2017-10-03 19:47:37 -03:00
2017-08-11 04:28:52 +02:00
2019-03-24 10:38:51 +01:00
2019-11-15 12:25:45 +01:00
2020-07-02 19:55:09 +02:00
2017-09-28 22:41:08 +01:00
2017-08-18 17:18:32 +01:00
2017-07-20 08:24:46 +01:00
2017-07-07 15:26:35 -04:00
2020-07-03 00:03:44 +02:00
2020-07-02 19:55:10 +02:00
2020-07-02 19:55:09 +02:00
2017-08-07 13:09:41 +02:00
2020-07-02 19:55:09 +02:00
2017-07-26 06:13:05 +07:00
2017-07-11 13:22:02 +07:00
2017-10-11 02:15:21 +02:00
2019-11-15 12:25:45 +01:00
2017-07-01 12:03:34 -03:00
2017-09-22 01:33:22 +02:00
2018-06-18 01:16:03 +02:00
2019-11-14 23:30:37 +01:00
2020-07-03 00:03:44 +02:00
2019-03-24 10:38:51 +01:00
2017-05-25 14:30:04 +02:00
2020-07-03 00:03:45 +02:00
2019-11-15 12:25:47 +01:00
2019-11-15 12:25:46 +01:00
2017-10-04 23:14:37 +01:00
2019-03-24 10:38:51 +01:00
2017-07-14 02:30:37 +02:00
2017-07-14 02:30:37 +02:00
2019-11-15 12:25:45 +01:00
2019-11-15 12:25:46 +01:00
2019-11-15 12:25:45 +01:00
2019-11-15 12:25:45 +01:00
2019-11-15 12:25:45 +01:00
2017-09-22 01:33:22 +02:00
2017-10-03 19:47:37 -03:00
2017-07-24 17:52:42 +02:00
2019-03-24 10:38:51 +01:00