Commit 573d041c authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst/ffmpegcolorspace/gstffmpegcolorspace.c: Return FALSE instead of returning...

gst/ffmpegcolorspace/gstffmpegcolorspace.c: Return FALSE instead of returning a random false unit size when the forma...

Original commit message from CVS:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_get_unit_size):
Return FALSE instead of returning a random false unit
size when the format isn't known/supported (even if
this shouldn't happen under normal circumstances).
parent 5b55df77
2006-08-30 Tim-Philipp Müller <tim at centricular dot net>
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_get_unit_size):
Return FALSE instead of returning a random false unit
size when the format isn't known/supported (even if
this shouldn't happen under normal circumstances).
2006-08-29 Wim Taymans <wim@fluendo.com>
 
Patch by: Tim-Philipp Müller <tim at centricular dot net>
......
......@@ -382,6 +382,7 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
GstFFMpegCsp *space = NULL;
GstStructure *structure = NULL;
AVCodecContext *ctx = NULL;
gboolean ret = TRUE;
gint width, height;
g_assert (size);
......@@ -396,8 +397,15 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
g_assert (ctx != NULL);
ctx->pix_fmt = PIX_FMT_NB;
gst_ffmpegcsp_caps_with_codectype (CODEC_TYPE_VIDEO, caps, ctx);
if (G_UNLIKELY (ctx->pix_fmt == PIX_FMT_NB)) {
ret = FALSE;
goto beach;
}
*size = avpicture_get_size (ctx->pix_fmt, width, height);
/* ffmpeg frames have the palette after the frame data, whereas
......@@ -408,11 +416,13 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
*size -= 4 * 256; /* = AVPALETTE_SIZE */
}
beach:
if (ctx->palctrl)
av_free (ctx->palctrl);
av_free (ctx);
return TRUE;
return ret;
}
#if 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment