Andreas Cadhalpun
22e960ad47
golomb: always check for invalid UE golomb codes in get_ue_golomb
...
Also correct the check to reject log < 7, because UPDATE_CACHE only
guarantees 25 meaningful bits.
This fixes undefined behavior:
runtime error: shift exponent is negative
Testing with START/STOP timers in get_ue_golomb, one for the first
branch (A) and one for the second (B), shows that there is practically no
slowdown, e.g. for the cavs decoder:
With the check in the B branch:
629 decicycles in get_ue_golomb B, 4194260 runs, 44 skips
433 decicycles in get_ue_golomb A,268434102 runs, 1354 skips
Without the check:
624 decicycles in get_ue_golomb B, 4194273 runs, 31 skips
433 decicycles in get_ue_golomb A,268434203 runs, 1253 skips
Since the B branch is executed far less often than the A branch, this
change is negligible, even more so for the h264 decoder, where the ratio
B/A is a lot smaller.
Fixes: mozilla bug 1230239
Fixes: fbeb8b2c7c996e9b91c6b1af319d7ebc/asan_heap-oob_195450f_2743_e8856ece4579ea486670be2b236099a0.bit
Found-by: Tyson Smith
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-14 20:51:39 +01:00
..
2015-12-12 14:20:01 +01:00
2015-12-04 02:35:42 +01:00
2015-12-01 19:05:19 -05:00
2015-12-10 18:25:02 +00:00
2015-11-24 20:36:40 -05:00
2015-11-28 09:41:15 -05:00
2015-11-28 09:41:15 -05:00
2015-12-02 07:47:37 -03:00
2015-12-14 18:53:09 +00:00
2015-11-27 17:51:42 +00:00
2015-12-02 07:47:37 -03:00
2015-12-08 13:31:55 +00:00
2015-12-08 13:31:50 +00:00
2015-12-14 18:53:09 +00:00
2015-12-14 18:53:09 +00:00
2015-12-14 18:53:09 +00:00
2015-11-24 20:36:40 -05:00
2015-11-24 20:36:40 -05:00
2015-12-02 07:47:37 -03:00
2015-12-09 07:36:58 -05:00
2015-12-12 12:19:07 +01:00
2015-12-09 07:36:58 -05:00
2015-12-09 07:36:58 -05:00
2015-12-12 19:05:07 +01:00
2015-12-12 12:19:07 +01:00
2015-11-28 09:41:15 -05:00
2015-11-28 09:41:15 -05:00
2015-11-30 18:29:57 -05:00
2015-11-22 16:16:16 -05:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-11-30 18:29:57 -05:00
2015-12-04 15:37:05 +01:00
2015-11-30 18:29:57 -05:00
2015-11-30 18:29:57 -05:00
2015-12-11 19:10:00 -05:00
2015-12-04 15:37:05 +01:00
2015-12-07 09:38:59 +01:00
2015-11-21 08:51:49 -05:00
2015-12-02 21:38:11 +01:00
2015-11-29 15:26:51 +01:00
2015-12-08 10:03:08 +01:00
2015-11-27 13:52:47 +01:00
2015-11-27 13:52:47 +01:00
2015-11-27 13:52:47 +01:00
2015-12-04 14:49:38 +01:00
2015-12-01 19:05:19 -05:00
2015-11-30 10:58:46 -05:00
2015-12-07 15:50:45 +01:00
2015-12-04 15:37:05 +01:00
2015-11-22 16:16:16 -05:00
2015-12-04 15:37:05 +01:00
2015-12-11 10:22:09 -05:00
2015-11-22 17:01:42 -05:00
2015-12-10 18:25:02 +00:00
2015-12-10 18:25:02 +00:00
2015-12-10 18:25:02 +00:00
2015-12-05 17:42:45 +01:00
2015-12-10 21:39:06 +00:00
2015-12-10 21:47:01 +00:00
2015-12-10 22:50:58 +00:00
2015-12-10 18:25:02 +00:00
2015-12-10 18:25:02 +00:00
2015-12-04 13:44:22 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-06 08:11:47 -05:00
2015-12-04 15:37:05 +01:00
2015-12-07 09:38:59 +01:00
2015-12-04 15:37:05 +01:00
2015-11-26 11:19:03 -05:00
2015-11-22 16:57:43 +00:00
2015-11-22 16:57:43 +00:00
2015-11-22 16:57:43 +00:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-07 17:25:51 +01:00
2015-12-04 15:37:05 +01:00
2015-12-07 15:50:45 +01:00
2015-12-08 09:50:59 +01:00
2015-12-07 15:50:45 +01:00
2015-12-07 16:10:51 +01:00
2015-12-13 22:56:49 +00:00
2015-12-14 20:51:39 +01:00
2015-11-27 13:52:47 +01:00
2015-12-04 01:55:11 +01:00
2015-11-29 03:27:28 +01:00
2015-11-27 13:52:47 +01:00
2015-12-08 18:09:27 +01:00
2015-11-27 23:37:42 +01:00
2015-12-05 22:34:30 +01:00
2015-12-05 22:34:30 +01:00
2015-12-08 10:03:51 +01:00
2015-12-08 22:00:05 -05:00
2015-12-04 18:54:39 +01:00
2015-11-27 21:02:13 +01:00
2015-12-08 03:37:04 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-09 07:36:58 -05:00
2015-12-11 10:35:15 -05:00
2015-12-06 22:40:41 +01:00
2015-12-11 19:10:00 -05:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 15:37:05 +01:00
2015-12-04 14:49:38 +01:00
2015-12-02 03:42:44 +01:00
2015-12-04 02:35:42 +01:00
2015-12-04 02:35:42 +01:00
2015-12-04 02:35:42 +01:00
2015-12-04 15:37:05 +01:00
2015-11-23 10:55:15 +01:00
2015-12-04 15:44:45 +01:00
2015-12-11 10:21:47 -05:00
2015-12-14 10:34:59 +01:00
2015-11-22 01:49:18 +01:00
2015-12-05 13:20:03 +01:00
2015-12-04 21:39:14 +01:00
2015-12-02 07:47:37 -03:00
2015-12-02 07:47:37 -03:00
2015-12-07 17:25:51 +01:00
2015-11-27 23:37:42 +01:00
2015-11-30 23:31:12 +01:00
2015-11-30 23:31:12 +01:00
2015-11-29 15:22:53 +01:00
2015-11-29 15:22:53 +01:00
2015-11-30 23:31:12 +01:00
2015-11-30 23:31:12 +01:00
2015-12-04 15:44:45 +01:00
2015-12-04 15:37:05 +01:00
2015-11-29 15:45:47 +01:00
2015-11-29 15:45:47 +01:00
2015-11-22 01:44:18 +01:00
2015-12-11 00:04:04 +01:00
2015-11-24 09:05:01 -05:00
2015-11-29 16:04:46 +01:00
2015-11-23 10:55:15 +01:00
2015-12-04 15:37:05 +01:00
2015-11-29 16:07:59 +01:00
2015-11-29 16:05:50 +01:00
2015-12-07 17:25:51 +01:00
2015-12-07 09:38:59 +01:00
2015-12-04 13:37:00 +01:00
2015-12-07 17:25:51 +01:00
2015-12-07 09:38:59 +01:00
2015-12-07 09:25:02 +01:00
2015-12-05 14:35:37 +01:00