// half-float NaNs will be converted to a single precision NaN
// half-float Infs will be converted to a single precision Inf
exp = FLOAT_MAX_BIASED_EXP;
- if (mantissa)
- mantissa = (1 << 23) - 1; // set all bits to indicate a NaN
+ mantissa <<= 13; // preserve half-float NaN bits if set
} else if (exp == 0x0) {
// convert half-float zero/denorm to single precision value
if (mantissa) {
// Zero out the start if ymin is not 0
for (i = 0; i < planes; i++) {
ptr = picture->data[i];
- for (y = 0; y < s->ymin; y++) {
+ for (y = 0; y < FFMIN(s->ymin, s->h); y++) {
memset(ptr, 0, out_line_size);
ptr += picture->linesize[i];
}
ymax = FFMAX(0, s->ymax + 1);
// Zero out the end if ymax+1 is not h
- for (i = 0; i < planes; i++) {
- ptr = picture->data[i] + (ymax * picture->linesize[i]);
- for (y = ymax; y < avctx->height; y++) {
- memset(ptr, 0, out_line_size);
- ptr += picture->linesize[i];
+ if (ymax < avctx->height)
+ for (i = 0; i < planes; i++) {
+ ptr = picture->data[i] + (ymax * picture->linesize[i]);
+ for (y = ymax; y < avctx->height; y++) {
+ memset(ptr, 0, out_line_size);
+ ptr += picture->linesize[i];
+ }
}
- }
picture->pict_type = AV_PICTURE_TYPE_I;
*got_frame = 1;