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

mediacodec: fix crash when color-format is invalid

Fail if GetVlcChromaFormat return 0.
(It'll throw a HardwareAccelerationError)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 40aa75316d6f3edc457354ac26295e292a8b1f9f)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c59dc61a
...@@ -831,8 +831,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong t ...@@ -831,8 +831,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong t
sar_den = p_dec->fmt_in.video.i_sar_den; sar_den = p_dec->fmt_in.video.i_sar_den;
} }
jni_SetAndroidSurfaceSizeEnv(env, width, height, width, height, sar_num, sar_den); jni_SetAndroidSurfaceSizeEnv(env, width, height, width, height, sar_num, sar_den);
} else } else {
GetVlcChromaFormat(p_sys->pixel_format, &p_dec->fmt_out.i_codec, &name); if (!GetVlcChromaFormat(p_sys->pixel_format,
&p_dec->fmt_out.i_codec, &name)) {
msg_Err(p_dec, "color-format not recognized");
p_sys->error_state = true;
return;
}
}
msg_Dbg(p_dec, "output: %d %s, %dx%d stride %d %d, crop %d %d %d %d", msg_Dbg(p_dec, "output: %d %s, %dx%d stride %d %d, crop %d %d %d %d",
p_sys->pixel_format, name, width, height, p_sys->stride, p_sys->slice_height, p_sys->pixel_format, name, width, height, p_sys->stride, p_sys->slice_height,
......
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