Browse code

prores: improve error message wording

Diego Biurrun authored on 2011/09/23 06:51:06
Showing 1 changed files
... ...
@@ -129,7 +129,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
129 129
 
130 130
     hdr_size = AV_RB16(buf);
131 131
     if (hdr_size > data_size) {
132
-        av_log(avctx, AV_LOG_ERROR, "frame data too short!\n");
132
+        av_log(avctx, AV_LOG_ERROR, "frame data too small\n");
133 133
         return -1;
134 134
     }
135 135
 
... ...
@@ -144,7 +144,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
144 144
     height = AV_RB16(buf + 10);
145 145
     if (width != avctx->width || height != avctx->height) {
146 146
         av_log(avctx, AV_LOG_ERROR,
147
-               "picture dimension changed! Old: %d x %d, new: %d x %d\n",
147
+               "picture dimension changed: old: %d x %d, new: %d x %d\n",
148 148
                avctx->width, avctx->height, width, height);
149 149
         return -1;
150 150
     }
... ...
@@ -152,7 +152,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
152 152
     ctx->frame_type = (buf[12] >> 2) & 3;
153 153
     if (ctx->frame_type > 2) {
154 154
         av_log(avctx, AV_LOG_ERROR,
155
-               "unsupported frame type: %d!\n", ctx->frame_type);
155
+               "unsupported frame type: %d\n", ctx->frame_type);
156 156
         return -1;
157 157
     }
158 158
 
... ...
@@ -168,7 +168,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
168 168
         break;
169 169
     default:
170 170
         av_log(avctx, AV_LOG_ERROR,
171
-               "unsupported picture format: %d!\n", ctx->pic_format);
171
+               "unsupported picture format: %d\n", ctx->pic_format);
172 172
         return -1;
173 173
     }
174 174
 
... ...
@@ -192,7 +192,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
192 192
     flags = buf[19];
193 193
     if (flags & 2) {
194 194
         if (ptr - buf > hdr_size - 64) {
195
-            av_log(avctx, AV_LOG_ERROR, "Too short header data\n");
195
+            av_log(avctx, AV_LOG_ERROR, "header data too small\n");
196 196
             return -1;
197 197
         }
198 198
         if (memcmp(ctx->qmat_luma, ptr, 64)) {
... ...
@@ -207,7 +207,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
207 207
 
208 208
     if (flags & 1) {
209 209
         if (ptr - buf > hdr_size - 64) {
210
-            av_log(avctx, AV_LOG_ERROR, "Too short header data\n");
210
+            av_log(avctx, AV_LOG_ERROR, "header data too small\n");
211 211
             return -1;
212 212
         }
213 213
         if (memcmp(ctx->qmat_chroma, ptr, 64)) {
... ...
@@ -233,13 +233,13 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
233 233
 
234 234
     hdr_size = data_size > 0 ? buf[0] >> 3 : 0;
235 235
     if (hdr_size < 8 || hdr_size > data_size) {
236
-        av_log(avctx, AV_LOG_ERROR, "picture header too short!\n");
236
+        av_log(avctx, AV_LOG_ERROR, "picture header too small\n");
237 237
         return -1;
238 238
     }
239 239
 
240 240
     pic_data_size = AV_RB32(buf + 1);
241 241
     if (pic_data_size > data_size) {
242
-        av_log(avctx, AV_LOG_ERROR, "picture data too short!\n");
242
+        av_log(avctx, AV_LOG_ERROR, "picture data too small\n");
243 243
         return -1;
244 244
     }
245 245
 
... ...
@@ -247,7 +247,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
247 247
     slice_height_factor = buf[7] & 0xF;
248 248
     if (slice_width_factor > 3 || slice_height_factor) {
249 249
         av_log(avctx, AV_LOG_ERROR,
250
-               "unsupported slice dimension: %d x %d!\n",
250
+               "unsupported slice dimension: %d x %d\n",
251 251
                1 << slice_width_factor, 1 << slice_height_factor);
252 252
         return -1;
253 253
     }
... ...
@@ -266,7 +266,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
266 266
 
267 267
     num_slices = num_x_slices * ctx->num_y_mbs;
268 268
     if (num_slices != AV_RB16(buf + 5)) {
269
-        av_log(avctx, AV_LOG_ERROR, "invalid number of slices!\n");
269
+        av_log(avctx, AV_LOG_ERROR, "invalid number of slices\n");
270 270
         return -1;
271 271
     }
272 272
 
... ...
@@ -279,7 +279,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
279 279
     }
280 280
 
281 281
     if (hdr_size + num_slices * 2 > data_size) {
282
-        av_log(avctx, AV_LOG_ERROR, "slice table too short!\n");
282
+        av_log(avctx, AV_LOG_ERROR, "slice table too small\n");
283 283
         return -1;
284 284
     }
285 285
 
... ...
@@ -294,7 +294,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
294 294
     ctx->slice_data_index[i] = data_ptr;
295 295
 
296 296
     if (data_ptr > buf + data_size) {
297
-        av_log(avctx, AV_LOG_ERROR, "out of slice data!\n");
297
+        av_log(avctx, AV_LOG_ERROR, "out of slice data\n");
298 298
         return -1;
299 299
     }
300 300
 
... ...
@@ -570,7 +570,7 @@ static int decode_slice(ProresContext *ctx, int pic_num, int slice_num,
570 570
     }
571 571
 
572 572
     if (slice_data_size < 6) {
573
-        av_log(avctx, AV_LOG_ERROR, "slice data too short!\n");
573
+        av_log(avctx, AV_LOG_ERROR, "slice data too small\n");
574 574
         return -1;
575 575
     }
576 576
 
... ...
@@ -581,7 +581,7 @@ static int decode_slice(ProresContext *ctx, int pic_num, int slice_num,
581 581
     v_data_size = slice_data_size - y_data_size - u_data_size - hdr_size;
582 582
 
583 583
     if (v_data_size < 0 || hdr_size < 6) {
584
-        av_log(avctx, AV_LOG_ERROR, "invalid data sizes!\n");
584
+        av_log(avctx, AV_LOG_ERROR, "invalid data size\n");
585 585
         return -1;
586 586
     }
587 587