diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/cropscale.c | 6 | ||||
-rw-r--r-- | libhb/hb.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libhb/cropscale.c b/libhb/cropscale.c index 548bdcc2e..a8a995a6c 100644 --- a/libhb/cropscale.c +++ b/libhb/cropscale.c @@ -202,6 +202,12 @@ static hb_buffer_t* crop_scale( hb_filter_private_t * pv, hb_buffer_t * in ) pv->pix_fmt = in->f.fmt; } + if (pv->context == NULL) + { + hb_buffer_close(&out); + return NULL; + } + // Scale pic_crop into pic_render according to the // context set up above sws_scale(pv->context, diff --git a/libhb/hb.c b/libhb/hb.c index ab61ff74e..e8418e741 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -240,7 +240,7 @@ hb_sws_get_context(int srcW, int srcH, enum AVPixelFormat srcFormat, 1 << 16 ); // saturation if (sws_init_context(ctx, NULL, NULL) < 0) { - fprintf(stderr, "Cannot initialize resampling context\n"); + hb_error("Cannot initialize resampling context"); sws_freeContext(ctx); ctx = NULL; } |