1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2012-12-14 20:57:25 +01:00
parent e095c4ea6d
commit a99c273a3f

View File

@ -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;