Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2b7f7748be447e1446f63b13da472ba7e00f329)
... | ... |
@@ -346,6 +346,11 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ |
346 | 346 |
sps->residual_color_transform_flag = get_bits1(&s->gb); |
347 | 347 |
sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8; |
348 | 348 |
sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8; |
349 |
+ if (sps->bit_depth_luma > 12U || sps->bit_depth_chroma > 12U) { |
|
350 |
+ av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n", |
|
351 |
+ sps->bit_depth_luma, sps->bit_depth_chroma); |
|
352 |
+ goto fail; |
|
353 |
+ } |
|
349 | 354 |
sps->transform_bypass = get_bits1(&s->gb); |
350 | 355 |
decode_scaling_matrices(h, sps, NULL, 1, sps->scaling_matrix4, sps->scaling_matrix8); |
351 | 356 |
}else{ |