Fixes division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -856,7 +856,7 @@ static int dirac_unpack_prediction_parameters(DiracContext *s) |
856 | 856 |
/*[DIRAC_STD] 11.2.4 motion_data_dimensions() |
857 | 857 |
Calculated in function dirac_unpack_block_motion_data */ |
858 | 858 |
|
859 |
- if (s->plane[0].xbsep < s->plane[0].xblen/2 || s->plane[0].ybsep < s->plane[0].yblen/2) { |
|
859 |
+ if (!s->plane[0].xbsep || !s->plane[0].ybsep || s->plane[0].xbsep < s->plane[0].xblen/2 || s->plane[0].ybsep < s->plane[0].yblen/2) { |
|
860 | 860 |
av_log(s->avctx, AV_LOG_ERROR, "Block separation too small\n"); |
861 | 861 |
return -1; |
862 | 862 |
} |