diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-06 00:14:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-06 01:09:04 +0200 |
commit | 98fe404a94063b28e66f32e8047e20136900f25f (patch) | |
tree | 81292a4bc5338bdba4588089197b27ad7f8ad11d /libavcodec/mpegvideo.h | |
parent | b5ef6f8eb452c37b19d973d61548725d7b91113e (diff) | |
download | ffmpeg-98fe404a94063b28e66f32e8047e20136900f25f.tar.gz |
Fix REBASE_PICTURE with h.264
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.h')
-rw-r--r-- | libavcodec/mpegvideo.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 3a47ebe2bc..fee75b248d 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -686,7 +686,10 @@ typedef struct MpegEncContext { void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block); } MpegEncContext; -#define REBASE_PICTURE(pic, new_ctx, old_ctx) (pic ? &new_ctx->picture[pic - old_ctx->picture] : NULL) +#define REBASE_PICTURE(pic, new_ctx, old_ctx) (pic ? \ + (pic >= old_ctx->picture && pic < old_ctx->picture+old_ctx->picture_count ?\ + &new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\ + : NULL) void MPV_decode_defaults(MpegEncContext *s); int MPV_common_init(MpegEncContext *s); |