summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-22 23:07:03 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-22 23:34:53 +0100
commit7517e932ffacdc99d34239f86314b376ffb63726 (patch)
treef676ffc8c822bbb4655da7ac755e55cf96c46456 /libavcodec/snow.c
parenta089d567f10e45ac3501f1f9741077a5df401859 (diff)
avcodec/snow: fix support for odd dimensions
Fixes Ticket3914 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 101c8f83e5..33a2dbc129 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -535,8 +535,8 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
int h= s->avctx->height;
if(plane_index){
- w>>= s->chroma_h_shift;
- h>>= s->chroma_v_shift;
+ w = FF_CEIL_RSHIFT(w, s->chroma_h_shift);
+ h = FF_CEIL_RSHIFT(h, s->chroma_v_shift);
}
s->plane[plane_index].width = w;
s->plane[plane_index].height= h;
@@ -590,8 +590,8 @@ static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *fra
for(p=0; p < s->nb_planes; p++){
int is_chroma= !!p;
- int w= is_chroma ? s->avctx->width >>s->chroma_h_shift : s->avctx->width;
- int h= is_chroma ? s->avctx->height>>s->chroma_v_shift : s->avctx->height;
+ int w= is_chroma ? FF_CEIL_RSHIFT(s->avctx->width, s->chroma_h_shift) : s->avctx->width;
+ int h= is_chroma ? FF_CEIL_RSHIFT(s->avctx->height, s->chroma_v_shift) : s->avctx->height;
int ls= frame->linesize[p];
uint8_t *src= frame->data[p];