Mercurial > mplayer.hg
comparison libmpcodecs/vf_remove_logo.c @ 37047:2921fb48ffb9
vf_remove_logo: sanity-check PGM width/height.
author | reimar |
---|---|
date | Sun, 06 Apr 2014 19:19:07 +0000 |
parents | ce9f83c64515 |
children |
comparison
equal
deleted
inserted
replaced
37046:ce9f83c64515 | 37047:2921fb48ffb9 |
---|---|
551 load_pgm_skip(input); | 551 load_pgm_skip(input); |
552 if (fscanf(input, "%i", &maximum_greyscale_value) != 1) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove-logo: Invalid PGM/PPM header.\n"); | 552 if (fscanf(input, "%i", &maximum_greyscale_value) != 1) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove-logo: Invalid PGM/PPM header.\n"); |
553 if (maximum_greyscale_value >= 256) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Only 1 byte per pixel (pgm) or 1 byte per color value (ppm) are supported.\n"); | 553 if (maximum_greyscale_value >= 256) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Only 1 byte per pixel (pgm) or 1 byte per color value (ppm) are supported.\n"); |
554 load_pgm_skip(input); | 554 load_pgm_skip(input); |
555 | 555 |
556 if (new_pgm->width <= 0 || new_pgm->width > 0x7fff || | |
557 new_pgm->height <= 0 || new_pgm->height > 0x7fff) | |
558 REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Invalid PGM dimensions.\n"); | |
556 image_size = new_pgm->width * new_pgm->height; | 559 image_size = new_pgm->width * new_pgm->height; |
557 new_pgm->pixel = safe_malloc (image_size); | 560 new_pgm->pixel = safe_malloc (image_size); |
558 | 561 |
559 /* Load the pixels. */ | 562 /* Load the pixels. */ |
560 /* Note: I am aware that fgetc(input) isn't the fastest way of doing things, but it is quite compact and the code only runs once when the filter is initialized.*/ | 563 /* Note: I am aware that fgetc(input) isn't the fastest way of doing things, but it is quite compact and the code only runs once when the filter is initialized.*/ |