Changeset 1e763454 in ffmpeg


Ignore:
Timestamp:
Jan 14, 2015, 4:10:19 PM (10 years ago)
Author:
Vittorio Giovara <vittorio.giovara@gmail.com>
Branches:
master
Children:
cd960c8a, cf70ba37
Parents:
456ffec3
git-author:
Vittorio Giovara <vittorio.giovara@gmail.com> (01/12/15 22:55:45)
git-committer:
Vittorio Giovara <vittorio.giovara@gmail.com> (01/14/15 16:10:19)
Message:

png: improve signature check

Return proper error code, print an error message and add missing
parentheses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libavcodec/pngdec.c

    r456ffec3 r1e763454  
    416416    /* check signature */
    417417    if (buf_size < 8 ||
    418         memcmp(buf, ff_pngsig, 8) != 0 &&
    419         memcmp(buf, ff_mngsig, 8) != 0)
    420         return -1;
     418        (memcmp(buf, ff_pngsig, 8) != 0 && memcmp(buf, ff_mngsig, 8) != 0)) {
     419        av_log(avctx, AV_LOG_ERROR, "Invalid PNG signature (%d).\n", buf_size);
     420        return AVERROR_INVALIDDATA;
     421    }
    421422
    422423    bytestream2_init(&s->gb, buf + 8, buf_size - 8);
Note: See TracChangeset for help on using the changeset viewer.