diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 20:57:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 20:58:01 +0100 |
commit | a99c273a3f91c3fd616b718c34a5848411ce0258 (patch) | |
tree | 033516327359e9381157fd48ae5970130050fceb /libavcodec/dnxhddec.c | |
parent | e095c4ea6dad8d486b1ed5c1df1ad836ed6e1b9d (diff) | |
download | ffmpeg-a99c273a3f91c3fd616b718c34a5848411ce0258.tar.gz |
dnxhddec: fix CID changed check.
Fixes Null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r-- | libavcodec/dnxhddec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 155505fcd9..0fe03f9978 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -37,7 +37,7 @@ typedef struct DNXHDContext { AVCodecContext *avctx; AVFrame picture; GetBitContext gb; - int cid; ///< compression id + int64_t cid; ///< compression id unsigned int width, height; unsigned int mb_width, mb_height; uint32_t mb_scan_index[68]; /* max for 1080p */ @@ -71,10 +71,11 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&ctx->picture); ctx->picture.type = AV_PICTURE_TYPE_I; ctx->picture.key_frame = 1; + ctx->cid = -1; return 0; } -static int dnxhd_init_vlc(DNXHDContext *ctx, int cid) +static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid) { if (cid != ctx->cid) { int index; |