Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-23 06:43:30 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-03-23 07:29:33 +0400
commitf927c5b753f2ec1f037ad38cb55b4407dd7a9d79 (patch)
treee1721111d1b895079627b0586c9c1e61ed79286b /libavformat/oggparsetheora.c
parentae2c33b0c28ec9dd2c78538062798f6dace6b20b (diff)
vorbisdemux: Check private context in theoras gtopts.
This prevents a null ptr dereference. It could be checked differently but this way it should be possible to return some data. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggparsetheora.c')
-rw-r--r--libavformat/oggparsetheora.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index d1559f4632..7ea4787913 100644
--- a/libavformat/oggparsetheora.c
+++ b/libavformat/oggparsetheora.c
@@ -131,8 +131,13 @@ theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp, int64_t *dts)
struct ogg *ogg = ctx->priv_data;
struct ogg_stream *os = ogg->streams + idx;
struct theora_params *thp = os->private;
- uint64_t iframe = gp >> thp->gpshift;
- uint64_t pframe = gp & thp->gpmask;
+ uint64_t iframe, pframe;
+
+ if (!thp)
+ return AV_NOPTS_VALUE;
+
+ iframe = gp >> thp->gpshift;
+ pframe = gp & thp->gpmask;
if (thp->version < 0x030201)
iframe++;