~ubuntu-branches/ubuntu/precise/libav/precise-updates

« back to all changes in this revision

Viewing changes to libavutil/lzo.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2014-07-15 07:24:55 UTC
  • mfrom: (1.2.21)
  • Revision ID: package-import@ubuntu.com-20140715072455-679saqmh168dxcir
Tags: 4:0.8.13-0ubuntu0.12.04.1
Update to 0.8.13 to fix multiple security issues (LP: #1341216)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
static inline void copy(LZOContext *c, int cnt) {
89
89
    register const uint8_t *src = c->in;
90
90
    register uint8_t *dst = c->out;
 
91
    if (cnt < 0) {
 
92
        c->error |= AV_LZO_ERROR;
 
93
        return;
 
94
    }
91
95
    if (cnt > c->in_end - src) {
92
96
        cnt = FFMAX(c->in_end - src, 0);
93
97
        c->error |= AV_LZO_INPUT_DEPLETED;
113
117
/**
114
118
 * @brief Copies previously decoded bytes to current position.
115
119
 * @param back how many bytes back we start
116
 
 * @param cnt number of bytes to copy, must be >= 0
 
120
 * @param cnt number of bytes to copy, must be > 0
117
121
 *
118
122
 * cnt > back is valid, this will copy the bytes we just copied,
119
123
 * thus creating a repeating pattern with a period length of back.
120
124
 */
121
125
static inline void copy_backptr(LZOContext *c, int back, int cnt) {
122
126
    register uint8_t *dst = c->out;
 
127
    if (cnt <= 0) {
 
128
        c->error |= AV_LZO_ERROR;
 
129
        return;
 
130
    }
123
131
    if (dst - c->out_start < back) {
124
132
        c->error |= AV_LZO_INVALID_BACKPTR;
125
133
        return;