give indication of why we segfault

Original commit message from CVS:
give indication of why we segfault
This commit is contained in:
Thomas Vander Stichele 2004-12-29 14:57:44 +00:00
parent df80b706a7
commit 7dc6d49cbb
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-12-29 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/ffmpegcolorspace/imgconvert.c:
give some indication of why we're segfaulting
2004-12-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:

View file

@ -290,6 +290,7 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
},
};
/* returns NULL if not found */
static PixFmtInfo *
get_pix_fmt_info (enum PixelFormat format)
{
@ -300,6 +301,11 @@ get_pix_fmt_info (enum PixelFormat format)
return pix_fmt_info + i;
}
}
/* since this doesn't get checked *anywhere*, we might as well warn
here if we return NULL so you have *some* idea what's going on */
g_warning ("Could not find info for pixel format %d, one segfault coming up",
format);
return NULL;
}
@ -405,7 +411,6 @@ avcodec_get_pix_fmt_loss (int dst_pix_fmt, int src_pix_fmt, int has_alpha)
/* compute loss */
loss = 0;
pf = get_pix_fmt_info (dst_pix_fmt);
if (pf->depth < ps->depth ||
(dst_pix_fmt == PIX_FMT_RGB555 && src_pix_fmt == PIX_FMT_RGB565))
loss |= FF_LOSS_DEPTH;