[FFmpeg-cvslog] avcodec/dvbsubdec: Check get_region() return value
Michael Niedermayer
git at videolan.org
Sat Jan 17 16:33:18 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 17 16:21:36 2015 +0100| [8de0990e9f22d7f728f70d5a03f3e78fc958f658] | committer: Michael Niedermayer
avcodec/dvbsubdec: Check get_region() return value
Fixes null pointer dereference with DEBUG enabled
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8de0990e9f22d7f728f70d5a03f3e78fc958f658
---
libavcodec/dvbsubdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ce68425..5dd362a 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;
More information about the ffmpeg-cvslog
mailing list