Browse Source

video_filter: assert when the input chroma is unknown

This should never happen. Maybe the chroma is 0 so we should not
display it as a string.
pull/162/head
Steve Lhomme 3 years ago
parent
commit
7b47c92a78
  1. 6
      modules/video_filter/croppadd.c
  2. 5
      modules/video_filter/freeze.c
  3. 6
      modules/video_filter/grain.c
  4. 5
      modules/video_filter/oldmovie.c
  5. 3
      modules/video_filter/psychedelic.c
  6. 7
      modules/video_filter/sharpen.c
  7. 3
      modules/video_filter/vhs.c

6
modules/video_filter/croppadd.c

@ -165,10 +165,10 @@ static int OpenFilter( filter_t *p_filter )
const vlc_chroma_description_t *p_chroma =
vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
if( p_chroma == NULL || p_chroma->plane_count == 0 )
assert( p_chroma != NULL );
if( p_chroma->plane_count == 0 )
{
msg_Err( p_filter, "Unknown input chroma %4.4s", p_filter->fmt_in.video.i_chroma?
(const char*)&p_filter->fmt_in.video.i_chroma : "xxxx" );
msg_Err( p_filter, "Unsupported input chroma %4.4s", (char*)&p_chroma->fcc );
return VLC_EGENERIC;
}

5
modules/video_filter/freeze.c

@ -109,8 +109,9 @@ static int Open( filter_t *p_filter )
/* Reject 0 bpp and unsupported chroma */
const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
const vlc_chroma_description_t *p_chroma
= vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
if( !p_chroma || p_chroma->pixel_size == 0
= vlc_fourcc_GetChromaDescription( fourcc );
assert( p_chroma != NULL );
if( p_chroma->pixel_size == 0
|| p_chroma->plane_count < 3 || p_chroma->pixel_size > 1
|| !vlc_fourcc_IsYUV( fourcc ) )
{

6
modules/video_filter/grain.c

@ -363,9 +363,9 @@ static int Open(filter_t *filter)
{
const vlc_chroma_description_t *chroma =
vlc_fourcc_GetChromaDescription(filter->fmt_in.video.i_chroma);
if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
msg_Err(filter, "Unsupported chroma (%4.4s)",
(char*)&(filter->fmt_in.video.i_chroma));
assert( chroma != NULL );
if (chroma->plane_count < 3 || chroma->pixel_size != 1) {
msg_Err(filter, "Unsupported chroma (%4.4s)", (char*)&chroma->fcc);
return VLC_EGENERIC;
}

5
modules/video_filter/oldmovie.c

@ -198,8 +198,9 @@ static int Open( filter_t *p_filter ) {
/* Reject 0 bpp and unsupported chroma */
const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
const vlc_chroma_description_t *p_chroma =
vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
if( !p_chroma || p_chroma->pixel_size == 0
vlc_fourcc_GetChromaDescription( fourcc );
assert( p_chroma != NULL );
if( p_chroma->pixel_size == 0
|| p_chroma->plane_count < 3 || p_chroma->pixel_size > 1
|| !vlc_fourcc_IsYUV( fourcc ) ) {

3
modules/video_filter/psychedelic.c

@ -79,7 +79,8 @@ static int Create( filter_t *p_filter )
{
const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
const vlc_chroma_description_t *p_chroma = vlc_fourcc_GetChromaDescription( fourcc );
if( !p_chroma || p_chroma->plane_count != 3 || p_chroma->pixel_size != 1 ) {
assert( p_chroma != NULL );
if( p_chroma->plane_count != 3 || p_chroma->pixel_size != 1 ) {
msg_Err( p_filter, "Unsupported chroma (%4.4s)", (char*)&fourcc );
return VLC_EGENERIC;
}

7
modules/video_filter/sharpen.c

@ -99,10 +99,11 @@ static int Create( filter_t *p_filter )
{
const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
const vlc_chroma_description_t *p_chroma = vlc_fourcc_GetChromaDescription( fourcc );
if( !p_chroma || p_chroma->plane_count != 3 ||
assert( p_chroma != NULL );
if( p_chroma->plane_count != 3 ||
(p_chroma->pixel_size != 1 &&
p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420_10L &&
p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420_10B)) {
fourcc != VLC_CODEC_I420_10L &&
fourcc != VLC_CODEC_I420_10B)) {
msg_Dbg( p_filter, "Unsupported chroma (%4.4s)", (char*)&fourcc );
return VLC_EGENERIC;
}

3
modules/video_filter/vhs.c

@ -126,7 +126,8 @@ static int Open( filter_t *p_filter )
const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
const vlc_chroma_description_t *p_chroma =
vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
if( !p_chroma || p_chroma->pixel_size == 0
assert( p_chroma != NULL );
if( p_chroma->pixel_size == 0
|| p_chroma->plane_count < 3 || p_chroma->pixel_size > 1
|| !vlc_fourcc_IsYUV( fourcc ) )
{

Loading…
Cancel
Save