Browse code

avcodec/hevc_ps: Check return code from pps_range_extensions()

Fixes out of array read
Fixes: asan_heap-oob_177e222_885_cov_1532528832_MERGE_D_TI_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f9440bd8122cc8798139c9370db0873a24ae14b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/11/27 10:31:46
Showing 1 changed files
... ...
@@ -1375,7 +1375,8 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
1375 1375
         int pps_range_extensions_flag = get_bits1(gb);
1376 1376
         /* int pps_extension_7bits = */ get_bits(gb, 7);
1377 1377
         if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
1378
-            pps_range_extensions(s, pps, sps);
1378
+            if ((ret = pps_range_extensions(s, pps, sps)) < 0)
1379
+                goto err;
1379 1380
         }
1380 1381
     }
1381 1382