summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-06 00:14:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-06 01:09:04 +0200
commit98fe404a94063b28e66f32e8047e20136900f25f (patch)
tree81292a4bc5338bdba4588089197b27ad7f8ad11d /libavcodec/mpegvideo.h
parentb5ef6f8eb452c37b19d973d61548725d7b91113e (diff)
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.h5
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);