aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-02 02:33:16 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-23 14:48:30 +0100
commitd79419d0f993ed1c4145b0a71bbf63d0e0976022 (patch)
tree4c58c2a18d776231f9af11a2e6c67644a0a067c8 /libavcodec/hevc.c
parentebc490e7445ccbcd1bc8ce6ded06e2fff209d40e (diff)
downloadandroid_external_ffmpeg-d79419d0f993ed1c4145b0a71bbf63d0e0976022.tar.gz
android_external_ffmpeg-d79419d0f993ed1c4145b0a71bbf63d0e0976022.tar.bz2
android_external_ffmpeg-d79419d0f993ed1c4145b0a71bbf63d0e0976022.zip
avcodec/hevc: propagate error code from hls_coding_quadtree()
Fixes use of uninitialized memory Fixes out of array read Fixes: asan_static-oob_123cee5_2630_cov_1869071233_PICSIZE_A_Bossen_1.bin Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 96c4ba2392b9cd55a5e84cb28db5c0c7e53cd390) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 2b57d13fb6..3ad8655aac 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1694,10 +1694,16 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
if (more_data < 0)
return more_data;
- if (more_data && x1 < s->sps->width)
+ if (more_data && x1 < s->sps->width) {
more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1);
- if (more_data && y1 < s->sps->height)
+ if (more_data < 0)
+ return more_data;
+ }
+ if (more_data && y1 < s->sps->height) {
more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1);
+ if (more_data < 0)
+ return more_data;
+ }
if (more_data && x1 < s->sps->width &&
y1 < s->sps->height) {
return hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1);