Commit a34f2273 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

mediacodec: fix width/height in case crop is invalid

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e645e0ec
...@@ -837,6 +837,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong t ...@@ -837,6 +837,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong t
p_dec->fmt_out.video.i_width = crop_right + 1 - crop_left; p_dec->fmt_out.video.i_width = crop_right + 1 - crop_left;
p_dec->fmt_out.video.i_height = crop_bottom + 1 - crop_top; p_dec->fmt_out.video.i_height = crop_bottom + 1 - crop_top;
if (p_dec->fmt_out.video.i_width <= 1
|| p_dec->fmt_out.video.i_height <= 1) {
p_dec->fmt_out.video.i_width = width;
p_dec->fmt_out.video.i_height = height;
}
p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width;
p_dec->fmt_out.video.i_visible_height = p_dec->fmt_out.video.i_height;
if (p_sys->stride <= 0) if (p_sys->stride <= 0)
p_sys->stride = width; p_sys->stride = width;
if (p_sys->slice_height <= 0) if (p_sys->slice_height <= 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment