summaryrefslogtreecommitdiffstats
path: root/libhb/cropscale.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-08-24 15:40:24 +0000
committerjstebbins <[email protected]>2015-08-24 15:40:24 +0000
commitd078868681a1892e1e67050ebafa1066efc45f73 (patch)
tree5fb026271a9c6dc189dc33c229ef14bd163239fb /libhb/cropscale.c
parentc20a45fac6c5a4a3052f103e8d1070aec152b259 (diff)
cropscale: prevent crash when scale dimensions too small
This will result in no video in the output file, but in such cases, this might actually be desirable. Scaling to such small dimensions is often used simply to re-encode audio. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7412 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/cropscale.c')
-rw-r--r--libhb/cropscale.c6
1 files changed, 6 insertions, 0 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,