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
..
2019-07-19 01:23:23 +02:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2020-05-19 17:17:36 +02:00
2020-05-20 03:16:34 +02:00
2020-05-20 04:02:44 +02:00
2020-05-20 04:05:39 +02:00
2020-05-19 17:17:35 +02:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-11-19 19:48:33 -03:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:56 +01:00
2019-08-04 21:16:28 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:36 +02:00
2019-07-08 22:59:41 +01:00
2019-07-17 17:56:15 -03:00
2020-05-19 17:17:35 +02:00
2019-09-04 20:26:35 +02:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:36 +02:00
2019-08-04 21:16:28 +02:00
2019-09-23 10:11:25 -03:00
2019-09-04 20:26:35 +02:00
2020-05-20 04:12:20 +02:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:35 +02:00
2019-12-31 16:57:37 -03:00
2020-05-19 17:17:36 +02:00
2019-07-08 22:59:41 +01:00
2020-05-21 15:32:28 +02:00
2019-07-20 11:28:09 -03:00
2020-05-20 00:10:47 +02:00
2019-12-31 16:57:37 -03:00
2019-12-31 16:57:37 -03:00
2020-05-19 17:17:36 +02:00
2020-05-21 15:32:28 +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-12-31 16:57:37 -03: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-12-31 16:57:37 -03:00
2020-05-20 03:51:23 +02:00
2019-08-04 21:16:28 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:35 +02:00
2019-09-04 20:26:35 +02:00
2019-08-05 19:34:33 +02:00
2019-09-04 20:26:35 +02:00
2019-07-17 23:18:50 +02:00
2020-05-20 03:45:50 +02:00
2020-05-19 17:17:36 +02:00
2020-05-21 15:32:28 +02:00
2020-05-19 17:17:36 +02:00
2020-05-20 02:46:10 +02:00
2019-07-13 19:34:15 +02:00
2019-07-20 19:05:02 +02:00
2019-12-31 19:51:56 +01:00
2019-08-04 21:16:28 +02:00
2019-08-04 21:16:28 +02:00
2020-05-20 03:35:10 +02:00
2019-12-06 21:33:54 -03:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:36 +02:00
2019-07-19 21:42:38 +02:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:36 +02:00
2020-05-20 03:12:40 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:55 +01:00
2019-07-08 09:56:29 +02:00
2019-08-04 16:19:25 +02:00
2019-07-19 21:42:38 +02:00
2019-07-08 22:59:41 +01:00
2019-07-08 22:59:41 +01:00
2019-07-19 21:42:38 +02:00
2019-07-14 13:04:46 -03:00
2019-08-27 20:10:35 -03:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2020-06-15 04:46:05 +02:00
2019-09-04 20:26:35 +02:00
2019-07-20 11:28:09 -03:00
2019-12-31 19:51:55 +01:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:56:08 +02:00
2019-12-31 19:51:55 +01:00
2019-07-13 14:42:57 +02:00
2019-07-13 14:42:57 +02:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:36 +02:00
2019-07-08 10:00:41 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:36 +02:00
2020-05-20 03:46:43 +02:00
2020-05-21 15:32:29 +02:00
2020-05-20 03:47:24 +02:00
2020-05-19 17:17:35 +02:00
2020-05-23 20:29:16 +02:00
2020-05-23 20:29:16 +02:00
2019-12-31 19:51:56 +01:00
2020-05-23 20:29:17 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:35 +02:00
2020-05-20 09:35:58 +02:00
2019-07-26 18:28:15 +02:00
2020-05-19 17:17:35 +02:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2019-12-31 16:57:37 -03:00
2019-09-27 22:28:16 -03:00
2019-12-31 19:51:55 +01:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:36 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-08-05 19:34:33 +02:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:36 +02:00
2020-06-04 19:02:25 +02:00
2019-09-02 13:53:08 -07:00
2019-07-17 23:18:50 +02:00
2020-05-20 03:24:57 +02:00
2020-05-19 17:17:35 +02:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:57 +01:00
2020-05-21 15:32:29 +02:00
2020-05-20 04:00:32 +02:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:56 +01:00
2020-05-20 04:08:57 +02:00
2020-05-19 17:17:36 +02:00
2020-05-19 17:17:35 +02:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:54:55 +02:00
2020-05-19 17:17:36 +02:00
2019-08-05 19:34:33 +02:00
2019-12-31 19:51:56 +01:00
2019-09-04 20:26:35 +02:00
2019-07-08 09:38:05 +02:00
2020-05-19 17:17:35 +02:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:36 +02:00
2019-07-08 09:38:03 +02:00
2019-07-20 13:43:06 -03:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2020-05-20 03:11:21 +02:00
2019-09-04 20:26:35 +02:00
2019-07-09 13:23:47 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2019-09-04 20:26:35 +02:00
2020-05-19 17:17:36 +02:00
2020-05-20 03:08:52 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:36 +02:00
2019-12-31 19:51:56 +01:00
2020-05-19 17:17:36 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:56 +01:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2020-05-19 17:17:35 +02:00
2019-07-21 18:36:18 +02:00
2019-07-11 09:34:34 +08:00
2020-05-19 17:17:35 +02:00
2019-09-06 23:00:46 +02:00
2019-09-04 20:26:35 +02: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
2020-05-19 17:17:36 +02:00
2019-09-04 20:26:35 +02:00
2019-12-31 19:51:55 +01:00
2019-12-31 19:51:55 +01:00
2019-08-05 19:34:33 +02:00
2020-05-20 03:22:16 +02:00
2019-12-31 19:51:57 +01:00
2019-12-31 19:51:57 +01:00
2020-05-21 15:32:28 +02:00
2019-12-31 19:51:57 +01:00
2020-05-19 17:17:35 +02:00
2019-12-31 19:51:56 +01:00
2020-05-21 15:32:28 +02:00
2020-05-20 00:16:37 +02:00