diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-17 16:21:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-17 16:33:02 +0100 |
commit | 8de0990e9f22d7f728f70d5a03f3e78fc958f658 (patch) | |
tree | dc54d3d1dd88583b48472e5a3a64240b927bfa1d /libavcodec/dvbsubdec.c | |
parent | edf1cb7aeea0f8fe0e3e785648a30a7ed99defd0 (diff) | |
download | ffmpeg-8de0990e9f22d7f728f70d5a03f3e78fc958f658.tar.gz |
avcodec/dvbsubdec: Check get_region() return value
Fixes null pointer dereference with DEBUG enabled
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r-- | libavcodec/dvbsubdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index ce68425b5b..5dd362a274 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1373,6 +1373,9 @@ static void save_display_set(DVBSubContext *ctx) for (display = ctx->display_list; display; display = display->next) { region = get_region(ctx, display->region_id); + if (!region) + return; + if (x_pos == -1) { x_pos = display->x_pos; y_pos = display->y_pos; @@ -1406,6 +1409,9 @@ static void save_display_set(DVBSubContext *ctx) for (display = ctx->display_list; display; display = display->next) { region = get_region(ctx, display->region_id); + if (!region) + return; + x_off = display->x_pos - x_pos; y_off = display->y_pos - y_pos; |